OpenSiv3D  v0.6.5
C++20 framework for creative coding
s3d::BinaryReader Class Reference

読み込み用バイナリファイル More...

#include <BinaryReader.hpp>

Inherits s3d::IReader.

Public Member Functions

SIV3D_NODISCARD_CXX20 BinaryReader ()
 デフォルトコンストラクタ More...
 
SIV3D_NODISCARD_CXX20 BinaryReader (FilePathView path)
 ファイルを開きます。 More...
 
bool supportsLookahead () const noexcept override
 lookahead をサポートしているかを返します。 More...
 
bool open (FilePathView path)
 ファイルを開きます。 More...
 
void close ()
 ファイルを閉じます。 More...
 
bool isOpen () const noexcept override
 ファイルが開いているかを返します。 More...
 
 operator bool () const noexcept
 ファイルが開いているかを返します。 More...
 
int64 size () const override
 ファイルのサイズを返します。 More...
 
int64 getPos () const override
 現在の読み込み位置を返します。 More...
 
bool setPos (int64 pos) override
 読み込み位置を変更します。 More...
 
int64 skip (int64 offset) override
 ファイルを読み飛ばし、読み込み位置を変更します。 More...
 
int64 read (void *dst, int64 size) override
 ファイルからデータを読み込みます。 More...
 
int64 read (void *dst, int64 pos, int64 size) override
 ファイルからデータを読み込みます。 More...
 
SIV3D_CONCEPT_TRIVIALLY_COPYABLE bool read (TriviallyCopyable &dst)
 ファイルからデータを読み込みます。 More...
 
int64 lookahead (void *dst, int64 size) const override
 読み込み位置を変更しないでファイルからデータを読み込みます。 More...
 
int64 lookahead (void *dst, int64 pos, int64 size) const override
 読み込み位置を変更しないでファイルからデータを読み込みます。 More...
 
SIV3D_CONCEPT_TRIVIALLY_COPYABLE bool lookahead (TriviallyCopyable &dst)
 読み込み位置を変更しないでファイルからデータを読み込みます。 More...
 
const FilePathpath () const noexcept
 開いているファイルのパスを返します。 More...
 
- Public Member Functions inherited from s3d::IReader
virtual ~IReader ()=default
 デストラクタ More...
 
SIV3D_CONCEPT_TRIVIALLY_COPYABLE bool read (TriviallyCopyable &dst)
 Reader からデータを読み込みます。 More...
 
SIV3D_CONCEPT_TRIVIALLY_COPYABLE bool lookahead (TriviallyCopyable &dst) const
 読み込み位置を変更しないで Reader からデータを読み込みます。 More...
 

Detailed Description

読み込み用バイナリファイル

Constructor & Destructor Documentation

◆ BinaryReader() [1/2]

SIV3D_NODISCARD_CXX20 s3d::BinaryReader::BinaryReader ( )

デフォルトコンストラクタ

◆ BinaryReader() [2/2]

SIV3D_NODISCARD_CXX20 s3d::BinaryReader::BinaryReader ( FilePathView  path)
explicit

ファイルを開きます。

Parameters
pathファイルパス

Member Function Documentation

◆ close()

void s3d::BinaryReader::close ( )

ファイルを閉じます。

Remarks
ファイルが開いていない場合は何もしません。

◆ getPos()

int64 s3d::BinaryReader::getPos ( ) const
overridevirtual

現在の読み込み位置を返します。

Returns
現在の読み込み位置(バイト)

Implements s3d::IReader.

◆ isOpen()

bool s3d::BinaryReader::isOpen ( ) const
overridevirtualnoexcept

ファイルが開いているかを返します。

Returns
ファイルが開いている場合 true, それ以外の場合は false

Implements s3d::IReader.

◆ lookahead() [1/3]

SIV3D_CONCEPT_TRIVIALLY_COPYABLE bool s3d::BinaryReader::lookahead ( TriviallyCopyable &  dst)

読み込み位置を変更しないでファイルからデータを読み込みます。

Template Parameters
TriviallyCopyable読み込む値の型
Parameters
dst読み込み先
Returns
読み込みに成功したら true, それ以外の場合は false

◆ lookahead() [2/3]

int64 s3d::BinaryReader::lookahead ( void *  dst,
int64  pos,
int64  size 
) const
overridevirtual

読み込み位置を変更しないでファイルからデータを読み込みます。

Parameters
dst読み込み先
pos先頭から数えた読み込み開始位置(バイト)
size読み込むサイズ(バイト)
Returns
実際に読み込んだサイズ(バイト)

Implements s3d::IReader.

◆ lookahead() [3/3]

int64 s3d::BinaryReader::lookahead ( void *  dst,
int64  size 
) const
overridevirtual

読み込み位置を変更しないでファイルからデータを読み込みます。

Parameters
dst読み込み先
size読み込むサイズ(バイト)
Returns
実際に読み込んだサイズ(バイト)

Implements s3d::IReader.

◆ open()

bool s3d::BinaryReader::open ( FilePathView  path)

ファイルを開きます。

Parameters
pathファイルパス
Returns
ファイルのオープンに成功した場合 true, それ以外の場合は false

◆ operator bool()

s3d::BinaryReader::operator bool ( ) const
explicitnoexcept

ファイルが開いているかを返します。

Returns
ファイルが開いている場合 true, それ以外の場合は false

◆ path()

const FilePath& s3d::BinaryReader::path ( ) const
noexcept

開いているファイルのパスを返します。

Returns
開いているファイルのパス。ファイルが開いていない場合は空の文字列

◆ read() [1/3]

SIV3D_CONCEPT_TRIVIALLY_COPYABLE bool s3d::BinaryReader::read ( TriviallyCopyable &  dst)

ファイルからデータを読み込みます。

Template Parameters
TriviallyCopyable読み込む値の型
Parameters
dst読み込み先
Returns
読み込みに成功したら true, それ以外の場合は false

◆ read() [2/3]

int64 s3d::BinaryReader::read ( void *  dst,
int64  pos,
int64  size 
)
overridevirtual

ファイルからデータを読み込みます。

Parameters
dst読み込み先
pos先頭から数えた読み込み開始位置(バイト)
size読み込むサイズ(バイト)
Returns
実際に読み込んだサイズ(バイト)

Implements s3d::IReader.

◆ read() [3/3]

int64 s3d::BinaryReader::read ( void *  dst,
int64  size 
)
overridevirtual

ファイルからデータを読み込みます。

Parameters
dst読み込み先
size読み込むサイズ(バイト)
Returns
実際に読み込んだサイズ(バイト)

Implements s3d::IReader.

◆ setPos()

bool s3d::BinaryReader::setPos ( int64  pos)
overridevirtual

読み込み位置を変更します。

Parameters
pos新しい読み込み位置(バイト)
Returns
読み込み位置の変更に成功した場合 true, それ以外の場合は false

Implements s3d::IReader.

◆ size()

int64 s3d::BinaryReader::size ( ) const
overridevirtual

ファイルのサイズを返します。

Returns
ファイルのサイズ(バイト)

Implements s3d::IReader.

◆ skip()

int64 s3d::BinaryReader::skip ( int64  offset)
overridevirtual

ファイルを読み飛ばし、読み込み位置を変更します。

Parameters
offset読み飛ばすサイズ(バイト)
Returns
新しい読み込み位置

Implements s3d::IReader.

◆ supportsLookahead()

bool s3d::BinaryReader::supportsLookahead ( ) const
overridevirtualnoexcept

lookahead をサポートしているかを返します。

Returns
true

Implements s3d::IReader.


The documentation for this class was generated from the following file: