|
YSTest
PreAlpha_b500_20140530
The YSLib Test Project
|
文本文件类。 更多...
#include <TextFile.h>


Public 成员函数 | |
| TextFile (const char *, std::ios_base::openmode=std::ios_base::in, Text::Encoding=Text::CS_Default) | |
| 构造:使用指定文件名、编码和模式初始化文本文件对象。 更多... | |
| TextFile (const String &) | |
| 构造:使用指定文件名初始化只读文本文件对象。 更多... | |
| string | GetBOM () const |
| 取 BOM 字符串。 更多... | |
| DefGetter (const ynothrow, u8, BOMSize, bl) DefGetter(const ynothrow | |
| GetSize ()-GetBOMSize()) DefGetter(const ynothrow | |
| < 取文本区段大小。 更多... | |
| 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 |
| 截断文本。 更多... | |
Public 成员函数 继承自 YSLib::File | |
| File () | |
| 构造。 更多... | |
| File (const char *, const char *="rb") | |
| 构造:使用指定文件路径初始化对象。 更多... | |
| File (const char *, std::ios_base::openmode) | |
| File (const String &, const ucs2_t *=u"rb") | |
| File (const String &, std::ios_base::openmode) | |
| virtual | ~File () |
| 析构。 更多... | |
| PDefHOp (bool,!,) const ynothrow ImplRet(!bool(*this)) explicit DefCvt(const ynothrow | |
| 判断无效性。 更多... | |
| fp | DefGetter (const ynothrow, FILE *, Ptr, fp) DefGetter(const ynothrow |
| fp fsize | DefGetter (const ynothrow, ptrdiff_t, Position, std::ftell(fp)) PDefH(int |
| < 取文件大小。 更多... | |
| fp fsize ptrdiff_t int whence const | ImplRet (std::fseek(fp, offset, whence)) PDefH(int |
| 检测文件结束符。 更多... | |
| void | Close () |
| 检查文件有效长度后读位置返回文件起始。 更多... | |
| bool | Open (const String &, const ucs2_t *=u"rb") |
| bool | Open (const String &, std::ios_base::openmode) |
Public 属性 | |
| Text::Encoding | Encoding |
| 编码。 更多... | |
| size_t | |
| TextSize | |
| TextPosition | |
Public 属性 继承自 YSLib::File | |
| bool | |
| fp | size_t |
| fp | Size |
| fp fsize | Seek |
| fp fsize ptrdiff_t | offset |
| fp fsize ptrdiff_t int whence const | CheckEOF |
Private 属性 | |
| size_t | bl |
| BOM 大小。 更多... | |
额外继承的成员函数 | |
相关函数 继承自 YSLib::File | |
| template<typename _tChar > | |
| File & | operator>> (File &f, typename std::char_traits< _tChar >::char_type &c) |
| 从指定文件读字符。 更多... | |
| template<typename _tString > | |
| File & | operator>> (File &f, _tString &str) |
| 从指定文件读空白符分隔的字符串。 更多... | |
| File & | operator<< (File &f, char c) |
| 向指定文件写字符。 更多... | |
| File & | operator<< (File &f, const char *str) |
| 向指定文件写字符串。 更多... | |
| template<typename _tString > | |
| File & | operator<< (File &f, const _tString &str) |
| 向指定文件写字符串。 更多... | |
文本文件类。
在文件 TextFile.h 第 56 行定义.
|
explicit |
构造:使用指定文件名、编码和模式初始化文本文件对象。
在文件 TextFile.cpp 第 80 行定义.
参考 YSLib::BOM_UTF_16BE, YSLib::BOM_UTF_16LE, YSLib::BOM_UTF_32BE, YSLib::BOM_UTF_32LE, YSLib::BOM_UTF_8, GetSize(), CHRLib::CharSet::UTF_16BE(), CHRLib::CharSet::UTF_16LE(), CHRLib::CharSet::UTF_32BE(), CHRLib::CharSet::UTF_32LE(), CHRLib::CharSet::UTF_8() , 以及 yunseq.

|
explicit |
| string YSLib::TextFile::GetBOM | ( | ) | const |
| YSLib::TextFile::GetSize | ( | ) | const |
|
inline |
| void YSLib::TextFile::Rewind | ( | ) | const |
|
inline |
按自身编码读取但不保存 Unicode 字符。
在文件 TextFile.h 第 135 行定义.
参考 YSLib::UI::args , 以及 CHRLib::MBCToUC().

|
private |
BOM 大小。
在文件 TextFile.h 第 59 行定义.
| Text::Encoding YSLib::TextFile::Encoding |
| YSLib::TextFile::size_t |
在文件 TextFile.h 第 92 行定义.
| YSLib::TextFile::TextPosition |
在文件 TextFile.h 第 94 行定义.
| YSLib::TextFile::TextSize |
在文件 TextFile.h 第 92 行定义.