|
fastdo
0.6.16
|
缓冲区,表示内存中一块二进制数据(利用malloc/realloc进行内存分配) 更多...
#include <utilities.hpp>

Public 成员函数 | |
| Buffer () | |
| 默认构造函数 更多... | |
| Buffer (void const *buf, size_t size, bool isPeek=false) | |
| 构造函数1 从一个缓冲区创建Buffer,可以指定是否为窥视模式 更多... | |
| template<typename _ChTy > | |
| Buffer (XString< _ChTy > const &data, bool isPeek=false) | |
| 构造函数2 从一个XString创建Buffer,可以指定是否为窥视模式 更多... | |
| template<typename _ChTy , typename = CharTypeConstrain<_ChTy>> | |
| Buffer (_ChTy const *str, size_t len=npos, bool isPeek=false) | |
| 构造函数3 从字符指针创建Buffer,可以指定是否为窥视模式 更多... | |
| virtual | ~Buffer () |
| 析构函数 更多... | |
| Buffer (Buffer const &other) | |
| 拷贝构造函数(只会拷贝数据大小长度的空间,而不是容量大小) 更多... | |
| Buffer & | operator= (Buffer const &other) |
| 拷贝赋值函数(只会拷贝数据大小长度的空间,而不是容量大小) 更多... | |
| Buffer (Buffer &&other) | |
| 移动构造函数 更多... | |
| Buffer & | operator= (Buffer &&other) |
| 移动赋值操作 更多... | |
| Buffer (GrowBuffer &&other) | |
| 移动构造函数1 更多... | |
| Buffer & | operator= (GrowBuffer &&other) |
| 移动赋值操作1 更多... | |
| void | setBuf (void const *buf, size_t size, size_t capacity, bool isPeek) |
| 设置缓冲区,当isPeek为false时拷贝数据缓冲区 更多... | |
| void | setBuf (void const *buf, size_t size, bool isPeek) |
| 设置缓冲区,当isPeek为false时拷贝数据缓冲区 更多... | |
| void | alloc (size_t capacity, bool setDataSize=true) |
| 分配容量大小,当setDataSize为true时设置数据长度 更多... | |
| void | realloc (size_t newCapacity) |
| 重新调整容量的大小,保留数据内容 更多... | |
| bool | peekCopy (bool copyCapacity=false) |
| 把窥探模式变为拷贝模式,如果copyCapacity为true时连容量也一起拷贝,否则只拷贝数据。 更多... | |
| void * | detachBuf (size_t *size=nullptr) |
| 使Buffer对象不再管理内存资源 更多... | |
| void | free () |
| 释放缓冲区 更多... | |
| void * | getBuf () const |
| 暴露缓冲区指针 更多... | |
| template<typename _Ty > | |
| _Ty * | getBuf () const |
| 暴露缓冲区指针 更多... | |
| void * | get () const |
| 暴露缓冲区指针 更多... | |
| template<typename _Ty > | |
| _Ty * | get () const |
| 暴露缓冲区指针 更多... | |
| winux::byte * | getAt (ssize_t i) const |
| 暴露缓冲区指定位置指针 更多... | |
| template<typename _Ty > | |
| _Ty * | getAt (ssize_t i) const |
| 暴露缓冲区指定位置指针 更多... | |
| winux::byte & | operator[] (size_t i) |
| 获取指定索引的字节 更多... | |
| winux::byte const & | operator[] (size_t i) const |
| 获取指定索引的字节 更多... | |
| winux::byte * | begin () |
| winux::byte * | end () |
| winux::byte const * | begin () const |
| winux::byte const * | end () const |
| size_t | getSize () const |
| 获取数据大小 更多... | |
| size_t | size () const |
| 获取数据字节大小 更多... | |
| template<typename _Ty > | |
| size_t | size () const |
| 获取大小 更多... | |
| template<typename _Ty > | |
| size_t | count () const |
| 获取大小 更多... | |
| void | _setSize (size_t dataSize) |
| 设置数据大小,不能超过容量大小(不建议外部调用) 更多... | |
| size_t | getCapacity () const |
| 获取容量大小 更多... | |
| size_t | capacity () const |
| 获取容量大小 更多... | |
| bool | isPeek () const |
| 是否为窥探模式 更多... | |
| operator bool () const | |
| 判断是否为一个有效的Buffer 更多... | |
| template<typename _ChTy > | |
| XString< _ChTy > | toString () const |
| 转换到字符串 更多... | |
| AnsiString | toAnsi () const |
| 转换到AnsiString 更多... | |
| UnicodeString | toUnicode () const |
| 转换到UnicodeString 更多... | |
| bool | operator== (Buffer const &other) const |
| bool | operator< (Buffer const &other) const |
| bool | operator> (Buffer const &other) const |
| bool | operator!= (Buffer const &other) const |
| bool | operator>= (Buffer const &other) const |
| bool | operator<= (Buffer const &other) const |
静态 Public 成员函数 | |
| static void * | Alloc (size_t size) |
| static void * | Realloc (void *p, size_t newSize) |
| static void | Free (void *p) |
Protected 成员函数 | |
| void | _zeroInit () |
| void | _copyConstruct (void const *buf, size_t size, bool isPeek) |
Protected 属性 | |
| void * | _buf |
| 缓冲区 更多... | |
| size_t | _dataSize |
| 数据的大小 更多... | |
| size_t | _capacity |
| 容量 更多... | |
| bool | _isPeek |
| 是否为窥视模式 更多... | |
友元 | |
| class | GrowBuffer |
缓冲区,表示内存中一块二进制数据(利用malloc/realloc进行内存分配)
在文件 utilities.hpp 第 906 行定义.
| winux::Buffer::Buffer | ( | ) |
默认构造函数
| winux::Buffer::Buffer | ( | void const * | buf, |
| size_t | size, | ||
| bool | isPeek = false |
||
| ) |
构造函数1 从一个缓冲区创建Buffer,可以指定是否为窥视模式
处于窥视模式时将不负责管理资源的释放
|
inline |
|
inline |
构造函数3 从字符指针创建Buffer,可以指定是否为窥视模式
在文件 utilities.hpp 第 933 行定义.
|
virtual |
析构函数
| winux::Buffer::Buffer | ( | Buffer const & | other | ) |
拷贝构造函数(只会拷贝数据大小长度的空间,而不是容量大小)
| winux::Buffer::Buffer | ( | Buffer && | other | ) |
移动构造函数
| winux::Buffer::Buffer | ( | GrowBuffer && | other | ) |
移动构造函数1
|
static |
|
static |
|
static |
| Buffer& winux::Buffer::operator= | ( | GrowBuffer && | other | ) |
移动赋值操作1
| void winux::Buffer::setBuf | ( | void const * | buf, |
| size_t | size, | ||
| size_t | capacity, | ||
| bool | isPeek | ||
| ) |
设置缓冲区,当isPeek为false时拷贝数据缓冲区
| buf | 缓冲区指针。如果为nullptr则分配空间后不进行数据拷贝 |
| size | 数据大小 |
| capacity | 缓冲区容量 |
| isPeek | 是否窥探模式。默认false拷贝数据 |
|
inline |
设置缓冲区,当isPeek为false时拷贝数据缓冲区
| buf | 缓冲区指针。如果为nullptr则分配空间后不进行数据拷贝 |
| size | 数据大小 |
| isPeek | 是否窥探模式。默认false拷贝数据 |
在文件 utilities.hpp 第 971 行定义.
| void winux::Buffer::alloc | ( | size_t | capacity, |
| bool | setDataSize = true |
||
| ) |
分配容量大小,当setDataSize为true时设置数据长度
| void winux::Buffer::realloc | ( | size_t | newCapacity | ) |
重新调整容量的大小,保留数据内容
| bool winux::Buffer::peekCopy | ( | bool | copyCapacity = false | ) |
把窥探模式变为拷贝模式,如果copyCapacity为true时连容量也一起拷贝,否则只拷贝数据。
| void* winux::Buffer::detachBuf | ( | size_t * | size = nullptr | ) |
使Buffer对象不再管理内存资源
| void winux::Buffer::free | ( | ) |
释放缓冲区
|
inline |
暴露缓冲区指针
在文件 utilities.hpp 第 993 行定义.
|
inline |
暴露缓冲区指针
在文件 utilities.hpp 第 997 行定义.
|
inline |
暴露缓冲区指针
在文件 utilities.hpp 第 1000 行定义.
|
inline |
暴露缓冲区指针
在文件 utilities.hpp 第 1004 行定义.
|
inline |
暴露缓冲区指定位置指针
在文件 utilities.hpp 第 1007 行定义.
|
inline |
暴露缓冲区指定位置指针
在文件 utilities.hpp 第 1011 行定义.
|
inline |
获取指定索引的字节
在文件 utilities.hpp 第 1014 行定义.
|
inline |
获取指定索引的字节
在文件 utilities.hpp 第 1016 行定义.
|
inline |
在文件 utilities.hpp 第 1019 行定义.
|
inline |
在文件 utilities.hpp 第 1020 行定义.
|
inline |
在文件 utilities.hpp 第 1021 行定义.
|
inline |
在文件 utilities.hpp 第 1022 行定义.
|
inline |
获取数据大小
在文件 utilities.hpp 第 1025 行定义.
|
inline |
获取数据字节大小
在文件 utilities.hpp 第 1028 行定义.
|
inline |
获取大小
在文件 utilities.hpp 第 1032 行定义.
|
inline |
获取大小
在文件 utilities.hpp 第 1036 行定义.
|
inline |
设置数据大小,不能超过容量大小(不建议外部调用)
在文件 utilities.hpp 第 1039 行定义.
|
inline |
获取容量大小
在文件 utilities.hpp 第 1042 行定义.
|
inline |
获取容量大小
在文件 utilities.hpp 第 1045 行定义.
|
inline |
是否为窥探模式
在文件 utilities.hpp 第 1048 行定义.
|
inline |
判断是否为一个有效的Buffer
在文件 utilities.hpp 第 1051 行定义.
|
inline |
转换到字符串
在文件 utilities.hpp 第 1055 行定义.
|
inline |
转换到AnsiString
在文件 utilities.hpp 第 1058 行定义.
|
inline |
转换到UnicodeString
在文件 utilities.hpp 第 1061 行定义.
|
inline |
在文件 utilities.hpp 第 1064 行定义.
|
inline |
在文件 utilities.hpp 第 1065 行定义.
|
inline |
在文件 utilities.hpp 第 1066 行定义.
|
inline |
在文件 utilities.hpp 第 1067 行定义.
|
inline |
在文件 utilities.hpp 第 1068 行定义.
|
inline |
在文件 utilities.hpp 第 1069 行定义.
|
protected |
|
protected |
|
friend |
在文件 utilities.hpp 第 1082 行定义.
|
protected |
缓冲区
在文件 utilities.hpp 第 1077 行定义.
|
protected |
数据的大小
在文件 utilities.hpp 第 1078 行定义.
|
protected |
容量
在文件 utilities.hpp 第 1079 行定义.
|
protected |
是否为窥视模式
在文件 utilities.hpp 第 1080 行定义.