|
Cytopia
0.3
A city building simulation game
|
#include "Filesystem.hxx"#include "Settings.hxx"#include "LOG.hxx"#include <fstream>#include <SDL.h>
Include dependency graph for Filesystem.cxx:Go to the source code of this file.
Namespaces | |
| fs | |
Functions | |
| std::string | readFileAsString (const std::string &fileName, bool binaryMode) |
| Read contents from a file as string. More... | |
| void | writeStringToFile (const std::string &fileName, const std::string &stringToWrite, bool binaryMode) |
| Write a string to a file. More... | |
| std::vector< std::string > | getDirectoryListing (const std::string &directory) |
| Get a directory listing of a given directory. More... | |
| std::vector< std::string > | getSaveGamePaths () |
| Get all savegames in the savegame directory. More... | |
| bool | fileExists (const std::string &filePath) |
| Check if a file (or folder) exists. More... | |
| void | writeStringToFileCompressed (const std::string &fileName, const std::string &stringToWrite) |
| Write a string to a file and compress it. More... | |
| void | createDirectory (const std::string &dir) |
| std::string | getBasePath () |
| Get base path (where Cytopia is being run) More... | |
| void fs::createDirectory | ( | const std::string & | dir | ) |
| bool fs::fileExists | ( | const std::string & | filePath | ) |
Check if a file (or folder) exists.
| filePath | Path to file or folder to check |
Definition at line 62 of file Filesystem.cxx.
Here is the caller graph for this function:| std::string fs::getBasePath | ( | ) |
Get base path (where Cytopia is being run)
A wrapper for SDL_GetBasePath, which is not run on Android because it hard-crashes the app. Memory is freed after the call.
Definition at line 77 of file Filesystem.cxx.
Here is the caller graph for this function:| std::vector< std::string > fs::getDirectoryListing | ( | const std::string & | directory | ) |
Get a directory listing of a given directory.
| directory | Name of the folder to retrieve the directory listing from |
Definition at line 55 of file Filesystem.cxx.
| std::vector< std::string > fs::getSaveGamePaths | ( | ) |
Get all savegames in the savegame directory.
Definition at line 60 of file Filesystem.cxx.
| std::string fs::readFileAsString | ( | const std::string & | fileName, |
| bool | binaryMode = false |
||
| ) |
Read contents from a file as string.
| fileName | Name of the file to read |
| binaryMode | (optional) open the file in binary mode. (default: false) |
Definition at line 12 of file Filesystem.cxx.
Here is the caller graph for this function:| void fs::writeStringToFile | ( | const std::string & | fileName, |
| const std::string & | stringToWrite, | ||
| bool | binaryMode = false |
||
| ) |
Write a string to a file.
| fileName | Name of the file to write |
| stringToWrite | string to be written |
| binaryMode | (optional) open the file in binary mode. (default: false) |
Definition at line 50 of file Filesystem.cxx.
Here is the caller graph for this function:| void fs::writeStringToFileCompressed | ( | const std::string & | fileName, |
| const std::string & | stringToWrite | ||
| ) |
Write a string to a file and compress it.
| fileName | Name of the file to write |
| stringToWrite | string to be written |
Definition at line 64 of file Filesystem.cxx.
Here is the caller graph for this function: