|
CBlueUI
C++ 跨平台跨框架的数据可视化工具
|
文件写入-工具类 更多...
Public 成员函数 | |
| FileWriter () | |
| ~FileWriter () | |
| LPCSTR | FileName () const |
| void | AddCacheLine (const BeString &text, UINT count=100) |
| 数据暂存于缓存数组(不同于系统缓冲区)。这里缓冲区时应用层面的。 | |
| void | Dataflush (UINT count, const char *mode) |
| 将数据同步到物理存储中。此过程为满足写次数count后,先关闭再打开 | |
| void | Close () |
| 关闭句柄 | |
| FILE * | Handler () const |
| 获得文件句柄指针 | |
| int | OpenFileA (const char *filename_utf8, const char *mode) |
| 打开准备写入的文件 | |
| int | OpenFileW (const WCHAR *filename, const WCHAR *mode) |
| 打开准备写入的文件 | |
| int | OpenFile (const TCHAR *filename, const TCHAR *mode) |
| 打开准备写入的文件 | |
| void | PrintfDataFrameLine (const std::vector< std::string > &line, char split_ch) |
| 写入文本。依次写入行文本数据+分隔符+换行符 | |
| void | PrintfWChar (LPCWSTR lpszFormat, va_list argList) |
| 格式化写入(宽字符版本)。 | |
| void | PrintfChar (LPCSTR lpszFormat, va_list argList) |
| 格式化写入(多字节字符版本)。 | |
| void | PrintfHexText (char *byte, int len, int group_count=32) |
| 以十六进制打印输出 | |
Protected 属性 | |
| FILE * | m_fp |
| BeStringA | m_file_full_path |
| BeStringA | m_file_mode |
| UINT | m_fflush_cur |
| std::vector< BeString > | m_write_caches |
文件写入-工具类
| BUI::FileWriter::FileWriter | ( | ) |
| BUI::FileWriter::~FileWriter | ( | ) |
数据暂存于缓存数组(不同于系统缓冲区)。这里缓冲区时应用层面的。
| text | : 文本内容 |
| count | : 当缓冲中存在count个数时,一次写入所有数据行。相当于写入文件IO的阈值。若count==0,表示立即写入 |
| void BUI::FileWriter::Close | ( | ) |
关闭句柄
| void BUI::FileWriter::Dataflush | ( | UINT | count, |
| const char * | mode | ||
| ) |
将数据同步到物理存储中。此过程为满足写次数count后,先关闭再打开
| count | 写入文件次数达到count后,先关闭再打开 |
| mode | : 重新打开的模式 |
| LPCSTR BUI::FileWriter::FileName | ( | ) | const |
| FILE * BUI::FileWriter::Handler | ( | ) | const |
获得文件句柄指针
打开准备写入的文件
| filename | 文件路径 |
| mode | 文件模式,不可以为空 |
| int BUI::FileWriter::OpenFileA | ( | const char * | filename_utf8, |
| const char * | mode | ||
| ) |
打开准备写入的文件
| filename_utf8 | 文件路径 |
| mode | 文件模式,不可以为空 |
打开准备写入的文件
| filename | 文件路径 |
| mode | 文件模式,不可以为空 |
| void BUI::FileWriter::PrintfChar | ( | LPCSTR | lpszFormat, |
| va_list | argList | ||
| ) |
格式化写入(多字节字符版本)。
| lpszFormat | : 格式文本 |
| argList | :参数列表 |
| void BUI::FileWriter::PrintfDataFrameLine | ( | const std::vector< std::string > & | line, |
| char | split_ch | ||
| ) |
写入文本。依次写入行文本数据+分隔符+换行符
| line | : 行文本数据 |
| split_ch | 分隔符号 |
| void BUI::FileWriter::PrintfHexText | ( | char * | byte, |
| int | len, | ||
| int | group_count = 32 |
||
| ) |
以十六进制打印输出
| byte | : 字节数据 |
| len | : 长度 |
| group_count | :在group_count个数据之后添加换行符号 |
| void BUI::FileWriter::PrintfWChar | ( | LPCWSTR | lpszFormat, |
| va_list | argList | ||
| ) |
格式化写入(宽字符版本)。
| lpszFormat | : 格式文本 |
| argList | :参数列表 |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |