YSTest  PreAlpha_b400_20130424
The YSLib Test Project
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
YSLib::Text::TextFileBuffer类 参考

#include <textmgr.h>

YSLib::Text::TextFileBuffer 的协作图:

class  Iterator
 目标编码迭代器类型。 更多...
 

Public 类型

typedef pair< vector< ucs2_t >
, size_t > 
BlockType
 缓冲区块类型。
 
typedef map< size_t, BlockTypeMapType
 缓冲映射类型。
 

Public 成员函数

 TextFileBuffer (TextFile &)
 构造:使用文本文件。
 
virtual ~TextFileBuffer ()
 析构:空实现。
 
BlockTypeoperator[] (size_t)
 块随机访问。
 
size_t GetBlockN () const ynothrow
 取缓冲区块数。
 
Encoding GetEncoding () const ynothrow
 
size_t GetSize () const ynothrow
 
size_t GetTextSize () const ynothrow
 
Iterator GetBegin () ynothrow
 取文本缓冲区起始迭代器。
 
Iterator GetEnd () ynothrow
 取文本缓冲区终止迭代器。
 
Iterator GetIterator (size_t)
 取文本字节位置对应的迭代器。
 
size_t GetPosition (Iterator)
 取迭代器对应的文本字节位置。
 

静态 Public 属性

static yconstexpr size_t BlockSize = 2048U
 默认文本区块大小。
 

Protected 属性

TextFileFile
 文本文件引用。
 
size_t nTextSize
 文本大小。
 
size_t nBlock
 区块数。
 
MapType Map
 缓冲映射。
 

Private 属性

size_t fixed_width
 固定编码每字符的字节数。
 
size_t max_width
 最大编码每字符的字节数。
 

详细描述

在文件 textmgr.h43 行定义.

成员类型定义说明

typedef pair<vector<ucs2_t>, size_t> YSLib::Text::TextFileBuffer::BlockType

缓冲区块类型。

保存转换后的文本区块和初始转换偏移状态。

自从
build 273

在文件 textmgr.h52 行定义.

缓冲映射类型。

区块号到指定缓冲区快的映射。

自从
build 273

在文件 textmgr.h59 行定义.

构造及析构函数说明

TextFileBuffer::TextFileBuffer ( TextFile file)
explicit

构造:使用文本文件。

在文件 textmgr.cpp114 行定义.

参考 fixed_width,max_width , 以及 YAssert.

virtual YSLib::Text::TextFileBuffer::~TextFileBuffer ( )
inlinevirtual

析构:空实现。

在文件 textmgr.h159 行定义.

成员函数说明

TextFileBuffer::Iterator TextFileBuffer::GetBegin ( )

取文本缓冲区起始迭代器。

注解
指向起始字符。
自从
build 273

在文件 textmgr.cpp165 行定义.

size_t YSLib::Text::TextFileBuffer::GetBlockN ( ) const
inline

取缓冲区块数。

自从
build 273

在文件 textmgr.h172 行定义.

Encoding YSLib::Text::TextFileBuffer::GetEncoding ( ) const
inline

在文件 textmgr.h173 行定义.

TextFileBuffer::Iterator TextFileBuffer::GetEnd ( )

取文本缓冲区终止迭代器。

注解
指向终止字符后一位置。
自从
build 273

在文件 textmgr.cpp170 行定义.

参考 nBlock.

参考自 GetIterator() , 以及 GetPosition().

这是这个函数的调用关系图:

TextFileBuffer::Iterator TextFileBuffer::GetIterator ( size_t  pos)

取文本字节位置对应的迭代器。

自从
build 273

在文件 textmgr.cpp175 行定义.

参考 BlockSize,CHRLib::ConvertCharacter(),YSL_BEGIN::FetchSkipMapperFunc(),fixed_width,CHRLib::GetCountOf(),GetEnd(),YSLib::File::GetPtr(),max_width,nTextSize,YAssert , 以及 YB_LIKELY.

函数调用图:

size_t YSLib::Text::TextFileBuffer::GetSize ( ) const
inline

在文件 textmgr.h174 行定义.

size_t YSLib::Text::TextFileBuffer::GetTextSize ( ) const
inline

在文件 textmgr.h175 行定义.

TextFileBuffer::BlockType & TextFileBuffer::operator[] ( size_t  idx)

类成员变量说明

yconstexpr size_t YSLib::Text::TextFileBuffer::BlockSize = 2048U
static

默认文本区块大小。

自从
build 273

在文件 textmgr.h113 行定义.

参考自 GetIterator(),GetPosition() , 以及 operator[]().

TextFile& YSLib::Text::TextFileBuffer::File
protected

文本文件引用。

自从
build 273

在文件 textmgr.h120 行定义.

size_t YSLib::Text::TextFileBuffer::fixed_width
private

固定编码每字符的字节数。

注解
变长编码为 1 。
自从
build 273;

在文件 textmgr.h143 行定义.

参考自 GetIterator(),GetPosition(),operator[]() , 以及 TextFileBuffer().

MapType YSLib::Text::TextFileBuffer::Map
protected

缓冲映射。

自从
build 273

在文件 textmgr.h135 行定义.

参考自 operator[]().

size_t YSLib::Text::TextFileBuffer::max_width
private

最大编码每字符的字节数。

自从
build 273;

在文件 textmgr.h148 行定义.

参考自 GetIterator(),GetPosition() , 以及 TextFileBuffer().

size_t YSLib::Text::TextFileBuffer::nBlock
protected

区块数。

自从
build 273

在文件 textmgr.h130 行定义.

参考自 GetEnd() , 以及 operator[]().

size_t YSLib::Text::TextFileBuffer::nTextSize
protected

文本大小。

自从
build 273

在文件 textmgr.h125 行定义.

参考自 GetIterator(),GetPosition() , 以及 operator[]().


该类的文档由以下文件生成: