CSV辅助工具
More...
#include <csv.h>
|
| template<typename TNUMBER> |
| static bool | parse_number_text (std::string_view atext, TNUMBER &adata) |
| | 解析数字文本
|
| template<typename TNUMBER> |
| static bool | number (csvpair &apair, TNUMBER &adata) |
| | 从CSV解析器状态读取数字
|
| static bool | readline (std::string &adata, int32_t &apos, std::string &aline) |
| | 读取一行CSV数据
|
CSV辅助工具
提供CSV解析的辅助功能,包括数字解析和行读取。
◆ number()
template<typename TNUMBER>
| bool ngl::csv_helper::number |
( |
csvpair & | apair, |
|
|
TNUMBER & | adata ) |
|
static |
从CSV解析器状态读取数字
- Template Parameters
-
- Parameters
-
- Returns
- 解析成功返回true
◆ parse_number_text()
template<typename TNUMBER>
| bool ngl::csv_helper::parse_number_text |
( |
std::string_view | atext, |
|
|
TNUMBER & | adata ) |
|
inlinestatic |
解析数字文本
- Template Parameters
-
- Parameters
-
- Returns
- 解析成功返回true
支持布尔值、整数和浮点数的解析,自动处理空格和格式验证。
◆ readline()
| bool ngl::csv_helper::readline |
( |
std::string & | adata, |
|
|
int32_t & | apos, |
|
|
std::string & | aline ) |
|
inlinestatic |
读取一行CSV数据
- Parameters
-
| adata | 输入数据字符串 |
| apos | 当前读取位置(会被更新) |
| aline | 输出行内容 |
- Returns
- 读取成功返回true
支持引号字段中的换行符。
The documentation for this struct was generated from the following file:
- E:/GitHub/ngl_server/public/cpp/tools/tab/csv/csv.h