バイトデータストリームクラス
[詳解]
#include <mgl_byte_stream.h>
|
|
constexpr | ByteStream () noexcept |
| | コンストラクタ
|
| |
| constexpr | ByteStream (void *address, size_t size) noexcept |
| | コンストラクタ
|
| |
| constexpr | ByteStream (const void *address, size_t size) noexcept |
| | コンストラクタ(読み込み専用)
|
| |
| void | SetBuffer (void *address, size_t size) noexcept |
| | バッファの設定
|
| |
| void | SetBuffer (const void *address, size_t size) noexcept |
| | バッファの設定(読み込み専用)
|
| |
| bool | SetOffset (size_t offset) noexcept |
| | オフセットの設定
|
| |
| constexpr size_t | GetOffset () const noexcept |
| | オフセットの取得
|
| |
| constexpr size_t | GetSize () const noexcept |
| | バッファサイズの取得
|
| |
| bool | Clear (ClearType clearType) noexcept |
| | データのクリア
|
| |
| constexpr void * | GetCurrentPoint () const noexcept |
| | 現在の先頭位置の取得
|
| |
| constexpr const void * | GetCurrentConstPoint () const noexcept |
| | 現在の先頭位置を取得(const版)
|
| |
| bool | Read (void *dest, size_t size) noexcept |
| | 読み込み
|
| |
| bool | Write (const void *source, size_t size) noexcept |
| | 書き込み
|
| |
| template<typename T > |
| constexpr bool | Read (T &value) noexcept |
| | 値の読み込み
|
| |
| template<typename T > |
| constexpr T | Read () noexcept |
| | 型を指定して値を読み込み
|
| |
| template<typename T > |
| constexpr bool | Write (T value) noexcept |
| | 値の書き込み
|
| |
| constexpr bool | IsOverflowed () const noexcept |
| | オーバーフローしているかを返す
|
| |
| bool | ReadBool (bool &flag) noexcept |
| | 論理値の読み込み
|
| |
| bool | ReadBool () noexcept |
| | 論理値の読み込み
|
| |
| bool | WriteBool (bool flag) noexcept |
| | 論理値の書き込み
|
| |
| bool | Fill (uint8_t value, size_t size) noexcept |
| | バッファを任意の値で埋める
|
| |
| bool | Skip (size_t size) noexcept |
| | ストリームのスキップ
|
| |
◆ ClearType
バッファクリア時の動作タイプ
| 列挙値 |
|---|
| Zero | ゼロ初期化
|
| Random | ランダム初期化
|
◆ ByteStream() [1/2]
| MGL::ByteStream::ByteStream |
( |
void * | address, |
|
|
size_t | size ) |
|
inlineconstexprnoexcept |
コンストラクタ
- 引数
-
| [in] | address | 設定するバッファのアドレス |
| [in] | size | バッファのサイズ |
◆ ByteStream() [2/2]
| MGL::ByteStream::ByteStream |
( |
const void * | address, |
|
|
size_t | size ) |
|
inlineconstexprnoexcept |
コンストラクタ(読み込み専用)
- 引数
-
| [in] | address | 設定するバッファのアドレス |
| [in] | size | バッファのサイズ |
◆ Clear()
| bool MGL::ByteStream::Clear |
( |
ClearType | clearType | ) |
|
|
noexcept |
◆ Fill()
| bool MGL::ByteStream::Fill |
( |
uint8_t | value, |
|
|
size_t | size ) |
|
noexcept |
バッファを任意の値で埋める
- 引数
-
| [in] | value | 書き込む値 |
| [in] | size | 書き込みサイズ |
- 戻り値
-
◆ GetCurrentConstPoint()
| const void * MGL::ByteStream::GetCurrentConstPoint |
( |
| ) |
const |
|
inlinenodiscardconstexprnoexcept |
現在の先頭位置を取得(const版)
- 戻り値
- 現在の先頭位置のアドレス
◆ GetCurrentPoint()
| void * MGL::ByteStream::GetCurrentPoint |
( |
| ) |
const |
|
inlinenodiscardconstexprnoexcept |
◆ GetOffset()
| size_t MGL::ByteStream::GetOffset |
( |
| ) |
const |
|
inlinenodiscardconstexprnoexcept |
◆ GetSize()
| size_t MGL::ByteStream::GetSize |
( |
| ) |
const |
|
inlinenodiscardconstexprnoexcept |
◆ IsOverflowed()
| bool MGL::ByteStream::IsOverflowed |
( |
| ) |
const |
|
inlinenodiscardconstexprnoexcept |
オーバーフローしているかを返す
- 戻り値
-
| true | オーバーフローしている |
| false | オーバーフローしていない |
◆ Read() [1/3]
template<typename T >
| T MGL::ByteStream::Read |
( |
| ) |
|
|
inlineconstexprnoexcept |
型を指定して値を読み込み
- テンプレート引数
-
- 覚え書き
- valueの型のサイズ分だけストリームから読み込む. valueの型がsizeofで取得できる必要がある.
◆ Read() [2/3]
template<typename T >
| bool MGL::ByteStream::Read |
( |
T & | value | ) |
|
|
inlineconstexprnoexcept |
値の読み込み
- 引数
-
- 覚え書き
- valueの型のサイズ分だけストリームから読み込む. valueの型がsizeofで取得できる必要がある.
◆ Read() [3/3]
| bool MGL::ByteStream::Read |
( |
void * | dest, |
|
|
size_t | size ) |
|
noexcept |
読み込み
- 引数
-
| [out] | dest | 読み込む値の格納先 |
| [in] | size | 読み込みサイズ |
- 戻り値
-
◆ ReadBool() [1/2]
| bool MGL::ByteStream::ReadBool |
( |
| ) |
|
|
noexcept |
論理値の読み込み
- 戻り値
- 読み込んだ論理値.読み込み失敗時はfalse
◆ ReadBool() [2/2]
| bool MGL::ByteStream::ReadBool |
( |
bool & | flag | ) |
|
|
noexcept |
◆ SetBuffer() [1/2]
| void MGL::ByteStream::SetBuffer |
( |
const void * | address, |
|
|
size_t | size ) |
|
noexcept |
バッファの設定(読み込み専用)
- 引数
-
| [in] | address | 設定するバッファのアドレス |
| [in] | size | バッファのサイズ |
◆ SetBuffer() [2/2]
| void MGL::ByteStream::SetBuffer |
( |
void * | address, |
|
|
size_t | size ) |
|
noexcept |
バッファの設定
- 引数
-
| [in] | address | 設定するバッファのアドレス |
| [in] | size | バッファのサイズ |
◆ SetOffset()
| bool MGL::ByteStream::SetOffset |
( |
size_t | offset | ) |
|
|
noexcept |
◆ Skip()
| bool MGL::ByteStream::Skip |
( |
size_t | size | ) |
|
|
noexcept |
◆ Write() [1/2]
| bool MGL::ByteStream::Write |
( |
const void * | source, |
|
|
size_t | size ) |
|
noexcept |
書き込み
- 引数
-
| [in] | source | 書き込むデータの先頭アドレス |
| [in] | size | 書き込むデータのサイズ |
- 戻り値
-
◆ Write() [2/2]
template<typename T >
| bool MGL::ByteStream::Write |
( |
T | value | ) |
|
|
inlineconstexprnoexcept |
値の書き込み
- 引数
-
- 覚え書き
- valueの型のサイズ分だけストリームから読み込む. valueの型がsizeofで取得できる必要がある.
◆ WriteBool()
| bool MGL::ByteStream::WriteBool |
( |
bool | flag | ) |
|
|
noexcept |
このクラス詳解は次のファイルから抽出されました: