All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Typedefs | Functions
inexor::filesystem Namespace Reference


using Path = boost::filesystem::path


std::string ExecutablePathWithoutBinary (const char *argv0)
std::string ExecutablePath (const char *argv0)
std::string ExecutablePathFallback (const char *argv0)
const char * getmediadir (int type)
 Returns the specific media dir according to type. More...
Path getmediapath (const std::string &basename, int type)
 Append the media directory specified by type to the basename. More...
std::stringgetmediapath (std::string &output, const std::string basename, int type)
const char * getmediapath (char *output, int outputlen, const std::string &basename, int type)
const std::string filecontents (const std::string &filename)
 Retrieve the contents of a text file. More...
const std::string filecontents_partly (const std::string &filename, size_t start_line, size_t end_line)
 Load the contents of a file in a specific section. More...
std::vector< Path > & list_files (Path folder, std::vector< Path > &file_list, Path ext)
 Retrieve a list of all files inside a folder (non recursively!). More...

Typedef Documentation

See Also
boost::filesystem::path We need to rename this class bc otherwise we get clashes with legacy code.

Function Documentation

std::string inexor::filesystem::ExecutablePath ( const char *  argv0)
std::string inexor::filesystem::ExecutablePathFallback ( const char *  argv0)

References path().

Referenced by ExecutablePath().

std::string inexor::filesystem::ExecutablePathWithoutBinary ( const char *  argv0)
const std::string inexor::filesystem::filecontents ( const std::string filename)

Retrieve the contents of a text file.

const std::string inexor::filesystem::filecontents_partly ( const std::string filename,
size_t  start_line,
size_t  end_line 

Load the contents of a file in a specific section.

filenamethe name of the file to load contents from
start_linethe first line we copy.
end_linethe last line we copy to the output string.
we count from 1 upwards (as you see it in your text-editor)
const char * inexor::filesystem::getmediadir ( int  type)

Returns the specific media dir according to type.

Returns the media-dir string of specific type.

References DIR_ICON, DIR_MAP, DIR_MUSIC, DIR_RADAR, DIR_SKYBOX, DIR_SOUND, DIR_TEXTURE, DIR_UI, icondir, interfacedir, mapdir, musicdir, radardir, skyboxdir, sounddir, and texturedir.

Referenced by getmediapath().

Path inexor::filesystem::getmediapath ( const std::string basename,
int  type 
std::string & inexor::filesystem::getmediapath ( std::string output,
const std::string  basename,
int  type 

References getmediapath().

const char * inexor::filesystem::getmediapath ( char *  output,
int  outputlen,
const std::string basename,
int  type 

Referenced by getmediapath().

std::vector< Path > & inexor::filesystem::list_files ( Path  folder,
std::vector< Path > &  file_list,
Path  ext 

Retrieve a list of all files inside a folder (non recursively!).

folderThe folder which contains the contents you want to retrieve a list from
file_listwhich will store and return all the file paths as a list
extneeds to be either empty or an extension to filter for (only those files get accepted) DOT needed! ".jpg"

References ext(), and recorder::file.