🛰️航天仿真算法库 SpaceAST
0.0.1
载入中...
搜索中...
未找到
GenericValue.hpp
浏览该文件的文档.
1
20
21
#pragma once
22
23
#include "AstGlobal.h"
24
#include "AstUtil/ParseFormat.hpp"
25
#include <string>
26
27
AST_NAMESPACE_BEGIN
28
33
class
GenericValue
34
{
35
public
:
36
GenericValue
() =
default
;
37
GenericValue
(
StringView
value)
38
: value_(value){}
39
GenericValue
(
const
char
* value)
40
: value_(value){}
41
GenericValue
(
const
std::string& value)
42
: value_(value){}
43
GenericValue
(
int
value)
44
: value_(
aFormatInt
(value)){}
45
GenericValue
(
double
value)
46
: value_(
aFormatDouble
(value)){}
47
GenericValue
(
bool
value)
48
: value_(
aFormatBool
(value)){}
49
GenericValue
(
Color
value)
50
: value_(
aFormatColor
(value)){}
51
52
const
std::string& value()
const
{
return
value_; }
53
const
char
* c_str()
const
{
return
value_.c_str(); }
54
protected
:
55
std::string value_;
56
};
57
58
AST_NAMESPACE_END
ast::Color
颜色类
定义
Color.hpp:87
ast::GenericValue
通用值类
定义
GenericValue.hpp:34
ast::StringViewBasic< char >
ast::aFormatDouble
errc_t aFormatDouble(double value, std::string &str, int precision)
将双精度浮点数格式化为字符串
定义
ParseFormat.cpp:500
ast::aFormatColor
errc_t aFormatColor(Color value, std::string &str)
将颜色值格式化为字符串
定义
ParseFormat.cpp:511
ast::aFormatInt
errc_t aFormatInt(int value, std::string &str)
将整数格式化为字符串
定义
ParseFormat.cpp:453
ast::aFormatBool
void aFormatBool(bool value, std::string &str)
将布尔值格式化为字符串
定义
ParseFormat.cpp:448
src
AstUtil
ParseFormat
GenericValue.hpp
制作者
1.12.0