ifw-core
2.0.0
|
Various file utilities. More...
Go to the source code of this file.
Namespaces | |
ctd::file | |
Enumerations | |
enum | ctd::file::RootType { ctd::file::SYSROOT = 1, ctd::file::INTROOT = 2, ctd::file::DATAROOT = 4, ctd::file::CFGPATH = 8, ctd::file::ROOTS_ALL = (SYSROOT | INTROOT | DATAROOT | CFGPATH), ctd::file::CFG_INT_ROOT = (CFGPATH | INTROOT) } |
Types of ELT deployment environment roots. More... | |
enum | ctd::file::ResourceType { ctd::file::RES_CONFIG = 1, ctd::file::RES_AUDIO = 2, ctd::file::RES_IMAGE = 4, ctd::file::RES_MODEL = 8, ctd::file::RES_DICTIONARY = 16, ctd::file::RES_DATA = 32, ctd::file::RES_ALL } |
Functions | |
std::string | ctd::file::RootVarTypeNbToString (const RootType type) |
Convert root type from number to string representation. More... | |
RootType | ctd::file::RootVarTypeStringToNb (const std::string &type) |
Convert root type from string to number representation. More... | |
std::string | ctd::file::ResDirNbToString (const ResourceType type) |
Convert resource type from number to string representation. More... | |
ResourceType | ctd::file::ResDirStringToNb (const std::string &type) |
Convert resource type from string to number representation. More... | |
std::string | ctd::file::ResolvePath (const std::string &filename) |
Resolve the filename if it contains env. variables, "~" and relative paths. More... | |
std::string | ctd::file::CreateIfwFilename (const std::string &filename, const RootType root, const ResourceType resource, const std::string &extension="") |
Create a resource path in the IFW deployment environment. More... | |
std::string | ctd::file::CheckAddExtension (const std::string &filename, const std::string &extension) |
Check if filename has the specified extension (no initiating dot). If not, add it. More... | |
void | ctd::file::RemoveFile (const std::string &filename) |
Remove the referenced file, if it exists. More... | |
std::string | ctd::file::FindFile (const std::string &filename, RootType roots=RootType::ROOTS_ALL, int32_t resources=RES_ALL, const bool exception=true) |
Locate file in the locations defined by the ELT ICS deployment environment. More... | |
std::string | ctd::file::LoadFile (const std::string &filename, std::string *complete_filename=nullptr, RootType roots=RootType::ROOTS_ALL, ResourceType resources=RES_ALL) |
Load a file and return the content. More... | |
void | ctd::file::SaveFile (const std::string &filename, const std::string &buffer, const bool overwrite=true) |
Save the contents inthe buffer into the given filename. More... | |
Variables | |
const std::string | ctd::file::SYSROOT_STR = "SYSROOT" |
const std::string | ctd::file::INTROOT_STR = "INTROOT" |
const std::string | ctd::file::DATAROOT_STR = "DATAROOT" |
const std::string | ctd::file::CFGPATH_STR = "CFGPATH" |
const std::string | ctd::file::RES_DIR = "resource" |
const std::string | ctd::file::RES_CONFIG_STR = "config" |
const std::string | ctd::file::RES_AUDIO_STR = "audio" |
const std::string | ctd::file::RES_IMAGE_STR = "image" |
const std::string | ctd::file::RES_MODEL_STR = "model" |
const std::string | ctd::file::RES_DICTIONARY_STR = "dictionary" |
const std::string | ctd::file::RES_DATA_STR = "data" |
Various file utilities.