dl
dl::String 命名空间参考

字符串操作 更多...

函数

Float toFloat (std::string_view str)
 字符串 -> Float
 
int toInt (std::string_view str, int default_v=0)
 转为整数,失败返回设定的默认值
 
int64_t toInt64 (std::string_view str, int64_t default_v=0)
 转为整数,失败返回设定的默认值
 
bool getInt (std::string_view str, int &ret)
 转为整数,失败不修改原值
 
template<std::size_t N>
std::array< int, N > toPoint (std::string_view str, char d=',')
 字符串 -> Point
 
template<std::size_t N>
std::array< Float, N > toPosition (std::string_view str, char d=',')
 字符串 -> Position
 
Point2 toPoint2 (std::string_view str, char d=',')
 
Position toPosition2 (std::string_view str, char d=',')
 
constexpr StringType GetType (std::string_view str)
 返回字符串类型
 
std::string AddQuotes (std::string_view str, char quotes='\"')
 
constexpr std::string_view GetNotFileName ()
 返回不能作为文件名的字符
 

详细描述

字符串操作

函数说明

◆ AddQuotes()

std::string dl::String::AddQuotes ( std::string_view str,
char quotes = '\"' )
inline

在文件 dl_string.h 第 268 行定义.

◆ getInt()

bool dl::String::getInt ( std::string_view str,
int & ret )
inline

转为整数,失败不修改原值

在文件 dl_string.h 第 199 行定义.

◆ GetNotFileName()

std::string_view dl::String::GetNotFileName ( )
constexpr

返回不能作为文件名的字符

在文件 dl_string.h 第 281 行定义.

◆ GetType()

StringType dl::String::GetType ( std::string_view str)
constexpr

返回字符串类型

在文件 dl_string.h 第 247 行定义.

◆ toFloat()

Float dl::String::toFloat ( std::string_view str)
inline

字符串 -> Float

在文件 dl_string.h 第 159 行定义.

◆ toInt()

int dl::String::toInt ( std::string_view str,
int default_v = 0 )
inline

转为整数,失败返回设定的默认值

注解
不建议依赖默认值,会增加代码复杂度

在文件 dl_string.h 第 170 行定义.

◆ toInt64()

int64_t dl::String::toInt64 ( std::string_view str,
int64_t default_v = 0 )
inline

转为整数,失败返回设定的默认值

注解
不建议依赖默认值,会增加代码复杂度

在文件 dl_string.h 第 185 行定义.

◆ toPoint()

template<std::size_t N>
std::array< int, N > dl::String::toPoint ( std::string_view str,
char d = ',' )

字符串 -> Point

在文件 dl_string.h 第 216 行定义.

◆ toPoint2()

Point2 dl::String::toPoint2 ( std::string_view str,
char d = ',' )
inline

在文件 dl_string.h 第 235 行定义.

◆ toPosition()

template<std::size_t N>
std::array< Float, N > dl::String::toPosition ( std::string_view str,
char d = ',' )

字符串 -> Position

在文件 dl_string.h 第 227 行定义.

◆ toPosition2()

Position dl::String::toPosition2 ( std::string_view str,
char d = ',' )
inline

在文件 dl_string.h 第 239 行定义.