OROCHI
 
Loading...
Searching...
No Matches
GxFile Class Reference

ファイル管理クラス More...

#include <GxFile.h>

Inheritance diagram for GxFile:
Collaboration diagram for GxFile:

Public Member Functions

初期化
 GxFile (void)
 コンストラクタ
 
 ~GxFile (void) override
 デストラクタ
 
アクセサ
constexpr u32 getPosition (void) const
 ファイルポインタ位置取得
 
constexpr u32 getSize (void) const
 ファイルサイズ取得
 
GX_FORCE_INLINE GX_CSTR getPath (void) const
 ファイルパス取得
 
GX_FORCE_INLINE b32 isOpened (void) const
 オープン済み判定
 
GX_FORCE_INLINE b32 isReadable (void) const
 読み取り可能判定
 
GX_FORCE_INLINE b32 isWritable (void) const
 書き込み可能判定
 
constexpr MODE getMode (void) const
 モード取得
 
constexpr STATE getState (void) const
 状態取得
 
GX_FORCE_INLINE b32 isAsync (void) const
 非同期処理フラグ取得
 
constexpr ASYNC_STATE getAsyncState (void) const
 非同期処理状態取得
 
constexpr ASYNC_ERROR getAsyncError (void) const
 非同期処理エラー取得
 
- Public Member Functions inherited from GxClassBase
constexpr GxClassBase (void)
 コンストラクタ
 
constexpr GxClassBase (const GxClassBase &base)
 コピーコンストラクタ
 
 ~GxClassBase (void) override
 デストラクタ
 
- Public Member Functions inherited from GxClassBaseRoot
constexpr GxClassBaseRoot (void)
 コンストラクタ
 
constexpr GxClassBaseRoot (const GxClassBaseRoot &)
 コピーコンストラクタ
 
virtual ~GxClassBaseRoot (void)
 デストラクタ
 
constexpr GxClassBaseRootoperator= (const GxClassBaseRoot &)
 代入演算子
 
virtual GxRttigetRtti (void) const =0
 Rttiの取得
 
virtual GX_FORCE_INLINE const GxTypedObjectgetDefaultObject (void)
 デフォルトオブジェクトを取得
 
GX_FORCE_INLINE b32 isDefaultObject (void)
 デフォルトオブジェクト判定
 

定義

enum class  MODE { READ = 1 , WRITE , READWRITE , TEMPORARY }
 ファイルアクセスモード More...
 
enum class  PROCESS_TYPE { SYNC = 0 , ASYNC }
 処理タイプ More...
 
enum class  SEEK_TYPE { BEGIN = 0 , CURRENT , END , MAX }
 シークタイプ More...
 
enum class  STATE { INITIALIZED = 0 , OPENED }
 状態 More...
 
enum class  ASYNC_STATE { NONE = 0 , PROGRESS , COMPLETE }
 非同期処理状態 More...
 
enum class  ASYNC_ERROR { CANCEL = -2 , INVALID = -1 , NONE = 0 }
 非同期処理エラー More...
 
typedef void(*) FILE_ASYNC_READ_USER_CALLBACK(void *pUser, GxFile &file, u32 size)
 非同期読み込みユーザコールバック関数定義
 
class GxSysFile
 
static constexpr u32 SECTOR_SIZE_MAX = GxMath::VALUE_2K
 最大パス文字列
 

操作

b32 open (GX_CSTR filename, MODE mode, PROCESS_TYPE type=PROCESS_TYPE::SYNC)
 ファイルオープン
 
void close (void)
 ファイルクローズ
 
u32 read (void *pDst, u32 size)
 ファイル読み込み
 
u32 write (const void *pSrc, u32 size)
 ファイル書き込み
 
u32 seek (s32 offset, SEEK_TYPE seekType=SEEK_TYPE::BEGIN)
 ファイルシーク
 
void flush (void)
 バッファフラッシュ
 
b32 setLastWriteTime (u64 time)
 ファイル更新日時設定
 
b32 readAsync (void *pDst, u32 size, FILE_ASYNC_READ_USER_CALLBACK userCallback=nullptr, void *pUser=nullptr)
 ファイル読み込み (非同期)
 
static b32 find (GxFileInformation &fileInfo, GX_CSTR path=nullptr)
 ファイル検索
 
static b32 move (GX_CSTR srcPath, GX_CSTR dstPath)
 ファイル移動
 
static b32 copy (GX_CSTR srcPath, GX_CSTR dstPath)
 ファイルコピー
 
static b32 remove (GX_CSTR path)
 ファイル削除
 
static b32 createDirectory (GX_CSTR path)
 ディレクトリ作成
 
static b32 createDirectoryEx (GX_CSTR path, b32 isRecursive=false)
 ディレクトリ作成 (指定の階層構造までの再帰作成)
 
static b32 removeDirectory (GX_CSTR path)
 ディレクトリ削除
 
static b32 isExist (GX_CSTR path)
 ファイル存在チェック
 
static b32 isDirectory (GX_CSTR path)
 ディレクトリチェック
 
static u64 getLastWriteTime (GX_CSTR path)
 最終更新日時の取得
 
static GX_FORCE_INLINE b32 move (const GxString &src, const GxString &dst)
 ファイル移動 (GxString指定)
 
static GX_FORCE_INLINE b32 copy (const GxString &src, const GxString &dst)
 ファイルコピー (GxString指定)
 
static GX_FORCE_INLINE b32 remove (const GxString &path)
 ファイル削除 (GxString指定)
 
static GX_FORCE_INLINE b32 createDirectory (const GxString &path)
 ディレクトリ作成 (GxString指定)
 
static GX_FORCE_INLINE b32 createDirectoryEx (const GxString &path)
 ディレクトリ再帰作成 (GxString指定)
 
static GX_FORCE_INLINE b32 removeDirectory (const GxString &path)
 ディレクトリ削除 (GxString指定)
 
static GX_FORCE_INLINE b32 isExist (const GxString &path)
 ファイル存在チェック (GxString指定)
 
static GX_FORCE_INLINE b32 isDirectory (const GxString &path)
 ディレクトリチェック (GxString指定)
 
static GX_FORCE_INLINE u64 getLastWriteTime (const GxString &path)
 最終更新日時の取得 (GxString指定)
 

Additional Inherited Members

- Static Public Member Functions inherited from GxClassBaseRoot
static GX_FORCE_INLINE GxRtti__getStaticRtti (void)
 Rttiの取得
 

Detailed Description

ファイル管理クラス

Member Enumeration Documentation

◆ ASYNC_ERROR

enum class GxFile::ASYNC_ERROR
strong

非同期処理エラー

Enumerator
CANCEL 

エラー:キャンセル

INVALID 

エラー:異常

NONE 

正常

◆ ASYNC_STATE

enum class GxFile::ASYNC_STATE
strong

非同期処理状態

Enumerator
NONE 

非同期処理していない

PROGRESS 

非同期処理中

COMPLETE 

非同期処理完了

◆ MODE

enum class GxFile::MODE
strong

ファイルアクセスモード

Enumerator
READ 

読み込み

WRITE 

書き込み

READWRITE 

読み書き可能

TEMPORARY 

テンポラリ

◆ PROCESS_TYPE

enum class GxFile::PROCESS_TYPE
strong

処理タイプ

Enumerator
SYNC 

同期処理

ASYNC 

非同期処理

◆ SEEK_TYPE

enum class GxFile::SEEK_TYPE
strong

シークタイプ

Enumerator
BEGIN 

先頭基準

CURRENT 

カレント基準

END 

末尾基準

MAX 

最大数

◆ STATE

enum class GxFile::STATE
strong

状態

Enumerator
INITIALIZED 

初期状態

OPENED 

オープン済み

Member Function Documentation

◆ copy()

b32 GxFile::copy ( GX_CSTR srcPath,
GX_CSTR dstPath )
static

ファイルコピー

Parameters
srcPath[in] コピー元ファイルパス
dstPath[in] コピー先ファイルパス
Returns
成功ならtrue
Note
移動先に同名ファイルがあった場合は強制上書きします。
Here is the call graph for this function:

◆ createDirectory()

b32 GxFile::createDirectory ( GX_CSTR path)
static

ディレクトリ作成

Parameters
path[in] 作成ディレクトリパス
Returns
成功ならtrue
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createDirectoryEx()

b32 GxFile::createDirectoryEx ( GX_CSTR path,
b32 isRecursive = false )
static

ディレクトリ作成 (指定の階層構造までの再帰作成)

Parameters
path[in] 作成ディレクトリパス (or ファイルパス)
isRecursive[in] 再帰呼び出し実行フラグ
Returns
1つでもディレクトリを追加したらtrue
Here is the call graph for this function:
Here is the caller graph for this function:

◆ find()

b32 GxFile::find ( GxFileInformation & fileInfo,
GX_CSTR path = nullptr )
static

ファイル検索

Parameters
fileInfo[out] 発見ファイル情報
path[in] 探索ファイルパス (nullptr指定の場合:続きから探索)
Returns
発見ならtrue
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getLastWriteTime()

u64 GxFile::getLastWriteTime ( GX_CSTR path)
static

最終更新日時の取得

Parameters
path[in] 指定ファイルパス
Returns
最終更新日時 (0の場合、取得失敗)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isDirectory()

b32 GxFile::isDirectory ( GX_CSTR path)
static

ディレクトリチェック

Parameters
path[in] 調査ディレクトリパス
Returns
ディレクトリならtrue
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isExist()

b32 GxFile::isExist ( GX_CSTR path)
static

ファイル存在チェック

Parameters
path[in] 調査ファイルパス
Returns
存在するならtrue
Here is the call graph for this function:
Here is the caller graph for this function:

◆ move()

b32 GxFile::move ( GX_CSTR srcPath,
GX_CSTR dstPath )
static

ファイル移動

Parameters
srcPath[in] 移動元ファイルパス
dstPath[in] 移動先ファイルパス
Returns
成功ならtrue
Here is the call graph for this function:

◆ open()

b32 GxFile::open ( GX_CSTR filename,
MODE mode,
PROCESS_TYPE type = PROCESS_TYPE::SYNC )

ファイルオープン

Parameters
filename[in] ファイル名
mode[in] ファイルアクセスモード
type[in] ファイル処理タイプ (同期/非同期)
Returns
成功ならtrue
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read()

u32 GxFile::read ( void * pDst,
u32 size )

ファイル読み込み

Parameters
pDst[out] 読み込み先バッファ
size[in] 読み込みサイズ (byte)
Returns
読み込みデータサイズ
Here is the call graph for this function:
Here is the caller graph for this function:

◆ readAsync()

b32 GxFile::readAsync ( void * pDst,
u32 size,
FILE_ASYNC_READ_USER_CALLBACK userCallback = nullptr,
void * pUser = nullptr )

ファイル読み込み (非同期)

Parameters
pDst[out] 読み込み先バッファ
size[in] 読み込みサイズ (byte)
userCallback[in] 登録コールバック関数
pUser[in] 登録コールバック関数ユーザポインタ
Returns
成功ならtrue
Note
本メソッドを呼び出す場合は open を非同期モードで行っておく必要があります。
Here is the call graph for this function:

◆ remove()

b32 GxFile::remove ( GX_CSTR path)
static

ファイル削除

Parameters
path[in] 削除ファイルパス
Returns
成功ならtrue
Here is the call graph for this function:

◆ removeDirectory()

b32 GxFile::removeDirectory ( GX_CSTR path)
static

ディレクトリ削除

Parameters
path[in] 削除ディレクトリパス
Returns
成功ならtrue
Here is the call graph for this function:

◆ seek()

u32 GxFile::seek ( s32 offset,
SEEK_TYPE seekType = SEEK_TYPE::BEGIN )

ファイルシーク

Parameters
offset[in] 移動オフセット
seekType[in] シークタイプ
Returns
シーク後カレントファイルポインタ位置
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setLastWriteTime()

b32 GxFile::setLastWriteTime ( u64 time)

ファイル更新日時設定

Parameters
time[in] 書き込み日時 (FILETIME形式の日時換算)
Returns
成功ならtrue

GX_DEVELOP

Here is the call graph for this function:

◆ write()

u32 GxFile::write ( const void * pSrc,
u32 size )

ファイル書き込み

Parameters
pSrc[in] 書き込み元バッファ
size[in] 書き込みサイズ (byte)
Returns
書き込みデータサイズ
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ SECTOR_SIZE_MAX

u32 GxFile::SECTOR_SIZE_MAX = GxMath::VALUE_2K
staticconstexpr

最大パス文字列

最大セクタサイズ


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