diff options
author | madmaxoft <github@xoft.cz> | 2013-10-09 09:38:47 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2013-10-09 09:38:47 +0200 |
commit | 2ff882f239f065585ad1b02f12b191bf99dd6626 (patch) | |
tree | a1d41562a820d965765b3ef22a0a892097fe27e7 /source/OSSupport/File.h | |
parent | Fixed warning in cFireSimulator. (diff) | |
download | cuberite-2ff882f239f065585ad1b02f12b191bf99dd6626.tar cuberite-2ff882f239f065585ad1b02f12b191bf99dd6626.tar.gz cuberite-2ff882f239f065585ad1b02f12b191bf99dd6626.tar.bz2 cuberite-2ff882f239f065585ad1b02f12b191bf99dd6626.tar.lz cuberite-2ff882f239f065585ad1b02f12b191bf99dd6626.tar.xz cuberite-2ff882f239f065585ad1b02f12b191bf99dd6626.tar.zst cuberite-2ff882f239f065585ad1b02f12b191bf99dd6626.zip |
Diffstat (limited to '')
-rw-r--r-- | source/OSSupport/File.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/source/OSSupport/File.h b/source/OSSupport/File.h index d4ea0d3a8..f47bd4041 100644 --- a/source/OSSupport/File.h +++ b/source/OSSupport/File.h @@ -41,9 +41,14 @@ Usage: +// tolua_begin + class cFile { public: + + // tolua_end + #ifdef _WIN32 static const char PathSeparator = '\\'; #else @@ -90,6 +95,8 @@ public: /// Reads the file from current position till EOF into an AString; returns the number of bytes read or -1 for error int ReadRestOfFile(AString & a_Contents); + // tolua_begin + /// Returns true if the file specified exists static bool Exists(const AString & a_FileName); @@ -99,9 +106,20 @@ public: /// Renames a file, returns true if successful. May fail if dest already exists (libc-dependant)! static bool Rename(const AString & a_OrigFileName, const AString & a_NewFileName); + /// Copies a file, returns true if successful. + static bool Copy(const AString & a_SrcFileName, const AString & a_DstFileName); + /// Returns true if the specified path is a folder static bool IsFolder(const AString & a_Path); + /// Returns true if the specified path is a regular file + static bool IsFile(const AString & a_Path); + + /// Returns the size of the file, or a negative number on error + static int GetSize(const AString & a_FileName); + + // tolua_end + int Printf(const char * a_Fmt, ...); private: @@ -110,7 +128,7 @@ private: #else HANDLE m_File; #endif -} ; +} ; // tolua_export |