Logo
クラス | 公開型 | 公開メンバ関数 | 静的公開メンバ関数 | 公開変数類 | 全メンバ一覧
Yukar.Common.FileUtil クラス

ファイル操作に関するユーティリティクラス [詳解]

クラス

struct  AssetEntry
 

公開型

enum  FileFuncFlags : uint {
  FO_MOVE = 0x1 , FO_COPY = 0x2 , FO_DELETE = 0x3 , FO_RENAME = 0x4 ,
  FO_MOVE = 0x1 , FO_COPY = 0x2 , FO_DELETE = 0x3 , FO_RENAME = 0x4
}
 
enum  FILEOP_FLAGS : ushort {
  FOF_MULTIDESTFILES = 0x1 , FOF_CONFIRMMOUSE = 0x2 , FOF_SILENT = 0x4 , FOF_RENAMEONCOLLISION = 0x8 ,
  FOF_NOCONFIRMATION = 0x10 , FOF_WANTMAPPINGHANDLE = 0x20 , FOF_ALLOWUNDO = 0x40 , FOF_FILESONLY = 0x80 ,
  FOF_SIMPLEPROGRESS = 0x100 , FOF_NOCONFIRMMKDIR = 0x200 , FOF_NOERRORUI = 0x400 , FOF_NOCOPYSECURITYATTRIBS = 0x800 ,
  FOF_NORECURSION = 0x1000 , FOF_NO_CONNECTED_ELEMENTS = 0x2000 , FOF_WANTNUKEWARNING = 0x4000 , FOF_NORECURSEREPARSE = 0x8000 ,
  FOF_MULTIDESTFILES = 0x1 , FOF_CONFIRMMOUSE = 0x2 , FOF_SILENT = 0x4 , FOF_RENAMEONCOLLISION = 0x8 ,
  FOF_NOCONFIRMATION = 0x10 , FOF_WANTMAPPINGHANDLE = 0x20 , FOF_ALLOWUNDO = 0x40 , FOF_FILESONLY = 0x80 ,
  FOF_SIMPLEPROGRESS = 0x100 , FOF_NOCONFIRMMKDIR = 0x200 , FOF_NOERRORUI = 0x400 , FOF_NOCOPYSECURITYATTRIBS = 0x800 ,
  FOF_NORECURSION = 0x1000 , FOF_NO_CONNECTED_ELEMENTS = 0x2000 , FOF_WANTNUKEWARNING = 0x4000 , FOF_NORECURSEREPARSE = 0x8000
}
 
enum  FileFuncFlags : uint {
  FO_MOVE = 0x1 , FO_COPY = 0x2 , FO_DELETE = 0x3 , FO_RENAME = 0x4 ,
  FO_MOVE = 0x1 , FO_COPY = 0x2 , FO_DELETE = 0x3 , FO_RENAME = 0x4
}
 ファイル操作種別 [詳解]
 
enum  FILEOP_FLAGS : ushort {
  FOF_MULTIDESTFILES = 0x1 , FOF_CONFIRMMOUSE = 0x2 , FOF_SILENT = 0x4 , FOF_RENAMEONCOLLISION = 0x8 ,
  FOF_NOCONFIRMATION = 0x10 , FOF_WANTMAPPINGHANDLE = 0x20 , FOF_ALLOWUNDO = 0x40 , FOF_FILESONLY = 0x80 ,
  FOF_SIMPLEPROGRESS = 0x100 , FOF_NOCONFIRMMKDIR = 0x200 , FOF_NOERRORUI = 0x400 , FOF_NOCOPYSECURITYATTRIBS = 0x800 ,
  FOF_NORECURSION = 0x1000 , FOF_NO_CONNECTED_ELEMENTS = 0x2000 , FOF_WANTNUKEWARNING = 0x4000 , FOF_NORECURSEREPARSE = 0x8000 ,
  FOF_MULTIDESTFILES = 0x1 , FOF_CONFIRMMOUSE = 0x2 , FOF_SILENT = 0x4 , FOF_RENAMEONCOLLISION = 0x8 ,
  FOF_NOCONFIRMATION = 0x10 , FOF_WANTMAPPINGHANDLE = 0x20 , FOF_ALLOWUNDO = 0x40 , FOF_FILESONLY = 0x80 ,
  FOF_SIMPLEPROGRESS = 0x100 , FOF_NOCONFIRMMKDIR = 0x200 , FOF_NOERRORUI = 0x400 , FOF_NOCOPYSECURITYATTRIBS = 0x800 ,
  FOF_NORECURSION = 0x1000 , FOF_NO_CONNECTED_ELEMENTS = 0x2000 , FOF_WANTNUKEWARNING = 0x4000 , FOF_NORECURSEREPARSE = 0x8000
}
 ファイル操作フラグ [詳解]
 

公開メンバ関数

string getFileName (string path)
 
string getFileNameWithoutExtension (string path)
 
virtual bool exists (string path)
 
virtual StreamReader getStreamReader (string path, Encoding encoding=null)
 
virtual string[] getDirectories (string path)
 
virtual string[] getDirectories (string path, string pattern, SearchOption searchOption)
 
virtual bool dirExists (string path)
 
virtual string getDirName (string path)
 
virtual string[] getFiles (string path)
 
virtual string[] getFiles (string path, string pattern, SearchOption searchOption=SearchOption.TopDirectoryOnly)
 
virtual Stream getFileStream (string path)
 
string getFileName (string path)
 
string getFileNameWithoutExtension (string path)
 
virtual bool exists (string path)
 
virtual StreamReader getStreamReader (string path, Encoding encoding=null)
 
virtual string[] getDirectories (string path)
 
virtual string[] getDirectories (string path, string pattern, SearchOption searchOption)
 
virtual bool dirExists (string path)
 
virtual string getDirName (string path)
 
virtual string[] getFiles (string path)
 
virtual string[] getFiles (string path, string pattern, SearchOption searchOption=SearchOption.TopDirectoryOnly)
 
virtual Stream getFileStream (string path)
 

静的公開メンバ関数

static void copyFile (IntPtr handle, List< string > srcList, List< string > destList)
 
static void copyFile (IntPtr handle, string src, string dest)
 
static void initialize ()
 
static string GetFullPath (string path)
 
static void copyFile (IntPtr handle, List< string > srcList, List< string > destList)
 
static void copyFile (IntPtr handle, string src, string dest)
 
static void deleteFile (IntPtr handle, List< string > deleteList, bool isConfirm)
 
static void initialize ()
 
static bool IsDefaultCheckFile (string path)
 
static MemoryStream getMemoryStream (string path)
 
static string GetFullPath (string path, bool inReturnCurrentFolderOnError=true)
 パスのフルパスを取得 [詳解]
 
static bool Exists (string inPath)
 ファイルの存在確認(エンジン再生対応) [詳解]
 
static string CreateNewFilePath (string inFolderName, string inFileName)
 新しいファイル名の作成 [詳解]
 
static string CreateTempDir ()
 テンポラリフォルダの作成 [詳解]
 
static string getValidFileName (string name)
 指定文字列をファイル名として有効な文字列に変換 [詳解]
 
static int DeleteFolder (string folderPath, IntPtr windowHandle)
 

公開変数類

bool skipUnexistedFiles
 

詳解

ファイル操作に関するユーティリティクラス

列挙型メンバ詳解

◆ FileFuncFlags [1/2]

列挙値
FO_MOVE 
FO_COPY 
FO_DELETE 
FO_RENAME 
FO_MOVE 
FO_COPY 
FO_DELETE 
FO_RENAME 

◆ FileFuncFlags [2/2]

ファイル操作種別

列挙値
FO_MOVE 
FO_COPY 
FO_DELETE 
FO_RENAME 
FO_MOVE 
FO_COPY 
FO_DELETE 
FO_RENAME 

◆ FILEOP_FLAGS [1/2]

列挙値
FOF_MULTIDESTFILES 
FOF_CONFIRMMOUSE 
FOF_SILENT 

Don't create progress/report

FOF_RENAMEONCOLLISION 
FOF_NOCONFIRMATION 

Don't prompt the user.

FOF_WANTMAPPINGHANDLE 

Fill in SHFILEOPSTRUCT.hNameMappings. Must be freed using SHFreeNameMappings

FOF_ALLOWUNDO 
FOF_FILESONLY 

On *.*, do only files

FOF_SIMPLEPROGRESS 

Don't show names of files

FOF_NOCONFIRMMKDIR 

Don't confirm making any needed dirs

FOF_NOERRORUI 

Don't put up error UI

FOF_NOCOPYSECURITYATTRIBS 

Dont copy NT file Security Attributes

FOF_NORECURSION 

Don't recurse into directories.

FOF_NO_CONNECTED_ELEMENTS 

Don't operate on connected elements.

FOF_WANTNUKEWARNING 

During delete operation, warn if nuking instead of recycling (partially overrides FOF_NOCONFIRMATION)

FOF_NORECURSEREPARSE 

Treat reparse points as objects, not containers

FOF_MULTIDESTFILES 
FOF_CONFIRMMOUSE 
FOF_SILENT 

Don't create progress/report

FOF_RENAMEONCOLLISION 
FOF_NOCONFIRMATION 

Don't prompt the user.

FOF_WANTMAPPINGHANDLE 

Fill in SHFILEOPSTRUCT.hNameMappings. Must be freed using SHFreeNameMappings

FOF_ALLOWUNDO 
FOF_FILESONLY 

On *.*, do only files

FOF_SIMPLEPROGRESS 

Don't show names of files

FOF_NOCONFIRMMKDIR 

Don't confirm making any needed dirs

FOF_NOERRORUI 

Don't put up error UI

FOF_NOCOPYSECURITYATTRIBS 

Dont copy NT file Security Attributes

FOF_NORECURSION 

Don't recurse into directories.

FOF_NO_CONNECTED_ELEMENTS 

Don't operate on connected elements.

FOF_WANTNUKEWARNING 

During delete operation, warn if nuking instead of recycling (partially overrides FOF_NOCONFIRMATION)

FOF_NORECURSEREPARSE 

Treat reparse points as objects, not containers

◆ FILEOP_FLAGS [2/2]

ファイル操作フラグ

列挙値
FOF_MULTIDESTFILES 
FOF_CONFIRMMOUSE 
FOF_SILENT 

Don't create progress/report

FOF_RENAMEONCOLLISION 
FOF_NOCONFIRMATION 

Don't prompt the user.

FOF_WANTMAPPINGHANDLE 

Fill in SHFILEOPSTRUCT.hNameMappings. Must be freed using SHFreeNameMappings

FOF_ALLOWUNDO 
FOF_FILESONLY 

On *.*, do only files

FOF_SIMPLEPROGRESS 

Don't show names of files

FOF_NOCONFIRMMKDIR 

Don't confirm making any needed dirs

FOF_NOERRORUI 

Don't put up error UI

FOF_NOCOPYSECURITYATTRIBS 

Dont copy NT file Security Attributes

FOF_NORECURSION 

Don't recurse into directories.

FOF_NO_CONNECTED_ELEMENTS 

Don't operate on connected elements.

FOF_WANTNUKEWARNING 

During delete operation, warn if nuking instead of recycling (partially overrides FOF_NOCONFIRMATION)

FOF_NORECURSEREPARSE 

Treat reparse points as objects, not containers

FOF_MULTIDESTFILES 
FOF_CONFIRMMOUSE 
FOF_SILENT 

Don't create progress/report

FOF_RENAMEONCOLLISION 
FOF_NOCONFIRMATION 

Don't prompt the user.

FOF_WANTMAPPINGHANDLE 

Fill in SHFILEOPSTRUCT.hNameMappings. Must be freed using SHFreeNameMappings

FOF_ALLOWUNDO 
FOF_FILESONLY 

On *.*, do only files

FOF_SIMPLEPROGRESS 

Don't show names of files

FOF_NOCONFIRMMKDIR 

Don't confirm making any needed dirs

FOF_NOERRORUI 

Don't put up error UI

FOF_NOCOPYSECURITYATTRIBS 

Dont copy NT file Security Attributes

FOF_NORECURSION 

Don't recurse into directories.

FOF_NO_CONNECTED_ELEMENTS 

Don't operate on connected elements.

FOF_WANTNUKEWARNING 

During delete operation, warn if nuking instead of recycling (partially overrides FOF_NOCONFIRMATION)

FOF_NORECURSEREPARSE 

Treat reparse points as objects, not containers

メソッド詳解

◆ copyFile() [1/4]

static void Yukar.Common.FileUtil.copyFile ( IntPtr  handle,
List< string >  srcList,
List< string >  destList 
)
static

◆ copyFile() [2/4]

static void Yukar.Common.FileUtil.copyFile ( IntPtr  handle,
List< string >  srcList,
List< string >  destList 
)
static

◆ copyFile() [3/4]

static void Yukar.Common.FileUtil.copyFile ( IntPtr  handle,
string  src,
string  dest 
)
static

◆ copyFile() [4/4]

static void Yukar.Common.FileUtil.copyFile ( IntPtr  handle,
string  src,
string  dest 
)
static

◆ CreateNewFilePath()

static string Yukar.Common.FileUtil.CreateNewFilePath ( string  inFolderName,
string  inFileName 
)
static

新しいファイル名の作成

引数
inFolderNameフォルダ名
inFileName元ファイル名
戻り値
新しいファイル名

◆ CreateTempDir()

static string Yukar.Common.FileUtil.CreateTempDir ( )
static

テンポラリフォルダの作成

戻り値
テンポラリフォルダのパス

◆ deleteFile()

static void Yukar.Common.FileUtil.deleteFile ( IntPtr  handle,
List< string >  deleteList,
bool  isConfirm 
)
static

◆ DeleteFolder()

static int Yukar.Common.FileUtil.DeleteFolder ( string  folderPath,
IntPtr  windowHandle 
)
static

◆ dirExists() [1/2]

virtual bool Yukar.Common.FileUtil.dirExists ( string  path)
virtual

◆ dirExists() [2/2]

virtual bool Yukar.Common.FileUtil.dirExists ( string  path)
virtual

◆ Exists()

static bool Yukar.Common.FileUtil.Exists ( string  inPath)
static

ファイルの存在確認(エンジン再生対応)

引数
inPathファイルパス
戻り値

◆ exists() [1/2]

virtual bool Yukar.Common.FileUtil.exists ( string  path)
virtual

◆ exists() [2/2]

virtual bool Yukar.Common.FileUtil.exists ( string  path)
virtual

◆ getDirectories() [1/4]

virtual string[] Yukar.Common.FileUtil.getDirectories ( string  path)
virtual

◆ getDirectories() [2/4]

virtual string[] Yukar.Common.FileUtil.getDirectories ( string  path)
virtual

◆ getDirectories() [3/4]

virtual string[] Yukar.Common.FileUtil.getDirectories ( string  path,
string  pattern,
SearchOption  searchOption 
)
virtual

◆ getDirectories() [4/4]

virtual string[] Yukar.Common.FileUtil.getDirectories ( string  path,
string  pattern,
SearchOption  searchOption 
)
virtual

◆ getDirName() [1/2]

virtual string Yukar.Common.FileUtil.getDirName ( string  path)
virtual

◆ getDirName() [2/2]

virtual string Yukar.Common.FileUtil.getDirName ( string  path)
virtual

◆ getFileName() [1/2]

string Yukar.Common.FileUtil.getFileName ( string  path)

◆ getFileName() [2/2]

string Yukar.Common.FileUtil.getFileName ( string  path)

◆ getFileNameWithoutExtension() [1/2]

string Yukar.Common.FileUtil.getFileNameWithoutExtension ( string  path)

◆ getFileNameWithoutExtension() [2/2]

string Yukar.Common.FileUtil.getFileNameWithoutExtension ( string  path)

◆ getFiles() [1/4]

virtual string[] Yukar.Common.FileUtil.getFiles ( string  path)
virtual

◆ getFiles() [2/4]

virtual string[] Yukar.Common.FileUtil.getFiles ( string  path)
virtual

◆ getFiles() [3/4]

virtual string[] Yukar.Common.FileUtil.getFiles ( string  path,
string  pattern,
SearchOption  searchOption = SearchOption.TopDirectoryOnly 
)
virtual

◆ getFiles() [4/4]

virtual string[] Yukar.Common.FileUtil.getFiles ( string  path,
string  pattern,
SearchOption  searchOption = SearchOption.TopDirectoryOnly 
)
virtual

◆ getFileStream() [1/2]

virtual Stream Yukar.Common.FileUtil.getFileStream ( string  path)
virtual

◆ getFileStream() [2/2]

virtual Stream Yukar.Common.FileUtil.getFileStream ( string  path)
virtual

◆ GetFullPath() [1/2]

static string Yukar.Common.FileUtil.GetFullPath ( string  path)
static

◆ GetFullPath() [2/2]

static string Yukar.Common.FileUtil.GetFullPath ( string  path,
bool  inReturnCurrentFolderOnError = true 
)
static

パスのフルパスを取得

引数
pathパス
inReturnCurrentFolderOnErrorエラー時にカレントフォルダを返す(false指定では空文字列)
戻り値

◆ getMemoryStream()

static MemoryStream Yukar.Common.FileUtil.getMemoryStream ( string  path)
static

◆ getStreamReader() [1/2]

virtual StreamReader Yukar.Common.FileUtil.getStreamReader ( string  path,
Encoding  encoding = null 
)
virtual

◆ getStreamReader() [2/2]

virtual StreamReader Yukar.Common.FileUtil.getStreamReader ( string  path,
Encoding  encoding = null 
)
virtual

◆ getValidFileName()

static string Yukar.Common.FileUtil.getValidFileName ( string  name)
static

指定文字列をファイル名として有効な文字列に変換

引数
name
戻り値

◆ initialize() [1/2]

static void Yukar.Common.FileUtil.initialize ( )
static

◆ initialize() [2/2]

static void Yukar.Common.FileUtil.initialize ( )
static

◆ IsDefaultCheckFile()

static bool Yukar.Common.FileUtil.IsDefaultCheckFile ( string  path)
static

メンバ詳解

◆ skipUnexistedFiles

bool Yukar.Common.FileUtil.skipUnexistedFiles