|
| TextFile (const_path_t, std::ios_base::openmode=std::ios_base::in, Text::Encoding=Text::CS_Default) |
| 构造:使用指定文件名、编码和模式初始化文本文件对象。
|
|
| TextFile (const String &) |
| 构造:使用指定文件名初始化只读文本文件对象。
|
|
string | GetBOM () const |
| 取 BOM 字符串。
|
|
u8 | GetBOMSize () const ynothrow |
| 取 BOM 大小。
|
|
size_t | GetTextSize () const ynothrow |
| 取文本区段大小。
|
|
size_t | GetTextPosition () const ynothrow |
| 取文件指针关于文本区段的位置。
|
|
size_t | CheckBOM (Text::Encoding &) |
| 检查文件头是否有 BOM(Byte Order Mark) ,若有则据此判断编码。
|
|
void | Locate (u32) const |
| 定位:设置文件读位置。
|
|
void | Rewind () const |
| 设置文件读位置为文本区段头。
|
|
template<typename _tChar , typename... _tParams> |
Text::ConversionResult | ReadChar (_tChar &c, _tParams &&...args) const |
| 按自身编码读取 Unicode 字符。
|
|
template<typename... _tParams> |
Text::ConversionResult | SkipChar (_tParams &&...args) const |
| 按自身编码读取但不保存 Unicode 字符。
|
|
bool | Truncate (size_t) const override |
| 截断文本。
|
|
| File () |
| 构造。
|
|
| File (const_path_t, const char *="rb") |
| 构造:使用指定文件路径初始化对象。
|
|
| File (const_path_t, std::ios_base::openmode) |
|
| File (const String &, const ucs2_t *=u"rb") |
|
| File (const String &, std::ios_base::openmode) |
|
virtual | ~File () |
| 析构。
|
|
bool | operator! () const ynothrow |
| 判断无效性。
|
|
| operator bool () const ynothrow |
| 判断有效性。
|
|
FILE * | GetPtr () const ynothrow |
| 取文件指针。
|
|
size_t | GetSize () const ynothrow |
| 取文件大小。
|
|
ptrdiff_t | GetPosition () const ynothrow |
| 取文件指针的位置,返回值语义同 std::ftell 。
|
|
int | Seek (ptrdiff_t offset, int whence) const |
| 设置文件指针位置。
|
|
int | CheckEOF () const |
| 检测文件结束符。
|
|
void | Close () |
| 关闭文件。
|
|
int | Flush () const |
| 刷新流。
|
|
size_t | Read (void *ptr, size_t size=1U, size_t nmemb=1U) const |
| 连续读 nmemb 个大小为 size 文件块到 ptr 中。
|
|
void | Rewind () const |
| 文件指针返回到文件头,语义同 std::rewind 。
|
|
size_t | Write (void *ptr, size_t size=1U, size_t nmemb=1U) const |
| 连续写 nmemb 个大小为 size 文件块到 ptr 中。
|
|
bool | Open (const_path_t, const char *="rb") |
| 以指定方式打开指定路径的文件。
|
|
bool | Open (const_path_t, std::ios_base::openmode) |
|
bool | Open (const String &, const ucs2_t *=u"rb") |
|
bool | Open (const String &, std::ios_base::openmode) |
|