6 #ifndef IFW_CTD_FILE_HPP_
7 #define IFW_CTD_FILE_HPP_
11 #include "ctd/defines/defines.hpp"
54 const std::string
RES_DIR =
"resource";
76 std::string
ResolvePath(
const std::string& filename);
82 const std::string& extension =
"");
86 const std::string& extension);
133 std::string
FindFile(
const std::string& filename,
136 const bool exception =
true);
148 std::string
LoadFile(
const std::string& filename,
149 std::string* complete_filename = NULL,
159 void SaveFile(
const std::string& filename,
160 const std::string& buffer,
161 const bool overwrite =
true);
167 #endif // !IFW_CTD_FILE_HPP_
void RemoveFile(const std::string &filename)
Remove the referenced file, if it exists.
Definition: file.cpp:75
const std::string RES_IMAGE_STR
Definition: file.hpp:57
std::string ResDirNbToString(ResourceType type)
Convert resource type from number to string representation.
Definition: file.cpp:40
const std::string SYSROOT_STR
Definition: file.hpp:31
const std::string RES_DIR
Definition: file.hpp:54
RootType RootVarTypeStringToNb(const std::string &type)
Convert root type from string to number representation.
Definition: file.cpp:30
std::string ResolvePath(const std::string &filename)
Resolve the filename if it contains env. variables, "~" and relative paths.
Definition: file.cpp:122
const std::string CFGROOT_STR
Definition: file.hpp:34
const std::string RES_CONFIG_STR
Definition: file.hpp:55
std::string CreateIfwFilename(const std::string &filename, const RootType root, const ResourceType resource, const std::string &extension)
Create a resource path in the IFW deployment environment.
Definition: file.cpp:90
const std::string DATAROOT_STR
Definition: file.hpp:33
ResourceType ResDirStringToNb(const std::string &type)
Convert resource type from string to number representation.
Definition: file.cpp:52
const std::string RES_MODEL_STR
Definition: file.hpp:58
RootType
Types of ELT deployment environment roots.
Definition: file.hpp:18
std::string RootVarTypeNbToString(RootType type)
Convert root type from number to string representation.
Definition: file.cpp:20
std::string CheckAddExtension(const std::string &filename, const std::string &extension)
Check if the filename has the specified extension (no initiating dot). If not, add it...
Definition: file.cpp:64
ResourceType
Types of resources found in the ELT deployment roots.
Definition: file.hpp:39
std::string FindFile(const std::string &filename, int32_t roots, int32_t resources, const bool exception)
Locate file in the locations defined by the ELT ICS deployment environment.
Definition: file.cpp:151
const std::string RES_AUDIO_STR
Definition: file.hpp:56
std::string LoadFile(const std::string &filename, std::string *complete_filename, RootType roots, ResourceType resources)
Load a file and return the content.
Definition: file.cpp:226
const std::string RES_DATA_STR
Definition: file.hpp:60
void SaveFile(const std::string &filename, const std::string &buffer, const bool overwrite)
Save the contents inthe buffer into the given filename.
Definition: file.cpp:250
const std::string RES_DICTIONARY_STR
Definition: file.hpp:59
const std::string INTROOT_STR
Definition: file.hpp:32