跳转至

Class qqmusic::utils::buffer

ClassList > qqmusic > utils > buffer

二进制缓冲区的统一表示

  • #include <buffer.h>

Inherits the following classes: std::vector< uint8_t >

Public Functions

Type Name
void append (const void * src_data_buf, size_t data_buf_size)
将一段内存插到这段buffer后面
buffer () = default
默认初始化
buffer (size_t size)
预先分配异丁醇长度
buffer (const uint8_t * src_head, size_t src_size)
直接从内存区域进行构造
buffer (std::vector< uint8_t > && other) noexcept
从std::vector<uint8_t>移动构造
buffer (buffer && other) noexcept
移动构造
buffer (size_t size, char c)
初始化为特定字符
buffer (const buffer & other) = default
拷贝构造函数
buffer operator+ (const buffer & a)
两段buffer拼接, 并返回构造新的buffer
buffer operator+= (const buffer & a)
将一段buffer插入本段buffer末尾
buffer & operator= (const buffer & other) = default
拷贝构造函数, 重载 = __
~buffer () = default

Public Functions Documentation

function append

将一段内存插到这段buffer后面

inline void qqmusic::utils::buffer::append (
    const void * src_data_buf,
    size_t data_buf_size
) 

Parameters:

  • src_data_buf 待插入数据的首地址
  • data_buf_size 待插入数据的长度

function buffer [1/7]

默认初始化

qqmusic::utils::buffer::buffer () = default


function buffer [2/7]

预先分配异丁醇长度

inline qqmusic::utils::buffer::buffer (
    size_t size
) 

Parameters:

  • size 预先分配长度

function buffer [3/7]

直接从内存区域进行构造

inline qqmusic::utils::buffer::buffer (
    const uint8_t * src_head,
    size_t src_size
) 

Parameters:

  • src_head 内存区域的首地址
  • src_size 内存区域长度

Note:

是拷贝初始化


function buffer [4/7]

从std::vector<uint8_t>移动构造

inline qqmusic::utils::buffer::buffer (
    std::vector< uint8_t > && other
) noexcept

Parameters:

  • other

function buffer [5/7]

移动构造

inline qqmusic::utils::buffer::buffer (
    buffer && other
) noexcept

Parameters:

  • other

function buffer [6/7]

初始化为特定字符

inline qqmusic::utils::buffer::buffer (
    size_t size,
    char c
) 

Parameters:

  • size 预先初始化长度
  • c 需要填充的字符

function buffer [7/7]

拷贝构造函数

qqmusic::utils::buffer::buffer (
    const buffer & other
) = default

Parameters:

  • other

function operator+

两段buffer拼接, 并返回构造新的buffer

inline buffer qqmusic::utils::buffer::operator+ (
    const buffer & a
) 

Parameters:

  • a

function operator+=

将一段buffer插入本段buffer末尾

inline buffer qqmusic::utils::buffer::operator+= (
    const buffer & a
) 

Parameters:

  • a

function operator=

拷贝构造函数, 重载 = __

buffer & qqmusic::utils::buffer::operator= (
    const buffer & other
) = default

Parameters:

  • other

function ~buffer

qqmusic::utils::buffer::~buffer () = default


The documentation for this class was generated from the following file include/qqmusic/utils/buffer.h