Cytopia  0.3
A city building simulation game
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Filesystem.hxx
Go to the documentation of this file.
1 #ifndef FILESYSTEM_HXX_
2 #define FILESYSTEM_HXX_
3 
4 #include <ciso646>
5 #include <string>
6 #include <vector>
7 
8 namespace fs
9 {
10 
16 std::string readFileAsString(const std::string &fileName, bool binaryMode = false);
17 
24 
30 void writeStringToFile(const std::string &fileName, const std::string &stringToWrite, bool binaryMode = false);
31 
36 void writeStringToFileCompressed(const std::string &fileName, const std::string &stringToWrite);
37 
42 std::vector<std::string> getDirectoryListing(const std::string &directory);
43 
47 std::vector<std::string> getSaveGamePaths();
48 
54 bool fileExists(const std::string &filePath);
55 
61 
62 void createDirectory(const std::string &dir);
63 
64 } // namespace fs
65 #endif
readFileAsString
std::string readFileAsString(const std::string &fileName, bool binaryMode=false)
Read contents from a file as string.
Definition: Filesystem.cxx:12
writeStringToFileCompressed
void writeStringToFileCompressed(const std::string &fileName, const std::string &stringToWrite)
Write a string to a file and compress it.
Definition: Filesystem.cxx:64
fileExists
bool fileExists(const std::string &filePath)
Check if a file (or folder) exists.
Definition: Filesystem.cxx:62
getDirectoryListing
std::vector< std::string > getDirectoryListing(const std::string &directory)
Get a directory listing of a given directory.
Definition: Filesystem.cxx:55
getBasePath
std::string getBasePath()
Get base path (where Cytopia is being run)
Definition: Filesystem.cxx:77
createDirectory
void createDirectory(const std::string &dir)
Definition: Filesystem.cxx:69
writeStringToFile
void writeStringToFile(const std::string &fileName, const std::string &stringToWrite, bool binaryMode=false)
Write a string to a file.
Definition: Filesystem.cxx:50
getSaveGamePaths
std::vector< std::string > getSaveGamePaths()
Get all savegames in the savegame directory.
Definition: Filesystem.cxx:60
string
std::string string
Definition: AudioConfig.hxx:14
readCompressedFileAsString
std::string readCompressedFileAsString(const std::string &fileName)
Read contents from a file as string.
Definition: Filesystem.cxx:71