added CSVFieldSplite.h/.cpp

This commit is contained in:
2023-07-12 18:34:57 +08:00
parent 9ed3f1b6c3
commit 8691bc0fe7
3 changed files with 93 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
#pragma once
namespace hgl
{
namespace util
{
/**
* CSV字段拆分工具<br>
* 支持逗号分隔与tab分隔以及使用引号包裹的字符串 */
class CSVFieldSplite
{
const char *str;
int str_length;
const char *sp;
const char *end;
public:
CSVFieldSplite(const char *s,const int length);
~CSVFieldSplite()=default;
const char *next_field(int *len);
};//class CSVFieldSplite
}//namespace util
}//namespace hgl