TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
fileutils.h
Go to the documentation of this file.
1 
13 #ifndef G3D_fileutils_h
14 #define G3D_fileutils_h
15 
16 #include "G3D/platform.h"
17 #include <string>
18 #include <stdio.h>
19 #include "G3D/Array.h"
20 #include "G3D/Set.h"
21 #include "G3D/g3dmath.h"
22 
23 #ifdef G3D_WINDOWS
24 // For chdir, mkdir, etc.
25 # include <direct.h>
26 #endif
27 
28 namespace G3D {
29 
31 std::string readWholeFile
32 (const std::string& filename);
33 
34 
40 void writeWholeFile(
41  const std::string& filename,
42  const std::string& str,
43  bool flush = true);
44 
45 
48 FILE* createTempFile();
49 
50 
63 bool zipfileExists
64 (const std::string& filename,
65  std::string& outZipfile,
66  std::string& outInternalFile);
67 
68 bool zipfileExists(const std::string& filename);
69 
94 void parseFilename(
95  const std::string& filename,
96  std::string& drive,
97  Array<std::string>& path,
98  std::string& base,
99  std::string& ext);
100 
101 
106 std::string filenameBaseExt(const std::string& filename);
107 
111 std::string filenameExt(const std::string& filename);
112 
113 
117 std::string filenameBase(const std::string& filename);
118 
121 std::string generateFilenameBase(const std::string& prefix = "", const std::string& suffix = "");
122 
128 std::string filenamePath(const std::string& filename);
129 
131 bool filenameContainsWildcards(const std::string& filename);
132 
134 std::string pathConcat(const std::string& dirname, const std::string& file);
135 
136 } // namespace
137 
138 #endif
139 
std::string filenameExt(const std::string &filename)
Definition: fileutils.cpp:859
FILE * createTempFile()
Definition: AABox.h:25
std::string readWholeFile(const std::string &filename)
Definition: fileutils.cpp:101
std::string filenamePath(const std::string &filename)
Definition: fileutils.cpp:869
bool filenameContainsWildcards(const std::string &filename)
Definition: fileutils.cpp:921
void writeWholeFile(const std::string &filename, const std::string &str, bool flush=true)
Definition: fileutils.cpp:207
std::string filenameBase(const std::string &filename)
Definition: fileutils.cpp:848
std::string generateFilenameBase(const std::string &prefix="", const std::string &suffix="")
Definition: fileutils.cpp:411
std::string pathConcat(const std::string &dirname, const std::string &file)
Definition: fileutils.cpp:47
std::string filenameBaseExt(const std::string &filename)
Definition: fileutils.cpp:825
bool zipfileExists(const std::string &filename, std::string &outZipfile, std::string &outInternalFile)
Definition: fileutils.cpp:335
void parseFilename(const std::string &filename, std::string &drive, Array< std::string > &path, std::string &base, std::string &ext)
Definition: fileutils.cpp:457