Go to the documentation of this file.
10 #include <SimoxUtility/algorithm/string.h>
21 const std::string& exportName,
23 memoryBasePath(memoryParentPath), exportName(exportName), _id(id)
31 auto current_date = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now());
32 std::tm* localTime = std::localtime(¤t_date);
36 ss << std::put_time(localTime,
"%Y_%m_%d");
37 std::string dateString = ss.str();
40 std::filesystem::path current_base_path = n;
41 current_base_path.append(dateString);
43 return current_base_path;
49 ARMARX_DEBUG <<
"Currently setting export name to: " << n;
64 if (json.find(
"DiskMemory.memoryParentPath") != json.end())
73 std::string p = [&](){
74 if(memoryBasePathString.empty()){
75 return memoryBasePath.string();
78 return memoryBasePathString;
138 bool createIfNotExistent)
const
146 const std::vector<unsigned char>&
data)
const
152 std::vector<unsigned char>
175 defs->optional(memoryBasePathString, prefix +
"exportPath");
Path addDateToMemoryBasePath(const std::filesystem::path &n) const
void ensureMemoryBasePathExists(bool createIfNotExistent=false) const
void ensureFileExists(const std::filesystem::path &p, bool createIfNotExistent=false)
Path getMemoryBasePath() const
void ensureFileExists(const std::string &filename, bool createIfNotExistent=false) const
void createPropertyDefinitions(PropertyDefinitionsPtr &defs, const std::string &prefix)
std::string str(bool escapeDelimiters=true) const
Get a string representation of this memory ID.
void writeDataToFile(const std::filesystem::path &p, const std::vector< unsigned char > &data)
std::vector< Path > getAllFiles() const
void setMixinMemoryID(const MemoryID &n)
#define ARMARX_CHECK_NOT_EMPTY(c)
std::vector< unsigned char > readDataFromFile(const std::filesystem::path &p)
void ensureDirectoryExists(const std::filesystem::path &p, bool createIfNotExistent=false)
std::vector< Path > getAllDirectories() const
bool fileExists(const std::string &filename) const
std::vector< unsigned char > readDataFromFile(const std::string &filename) const
std::vector< std::filesystem::path > getAllDirectories(const std::filesystem::path &p)
void setMixinExportName(const std::string &n)
DiskMemoryItemMixin()=default
std::filesystem::path toPath(const std::filesystem::path &base, const armem::MemoryID &id)
bool directoryExists(const std::filesystem::path &p)
bool fullPathExists() const
static bool ReplaceEnvVars(std::string &string)
ReplaceEnvVars replaces environment variables in a string with their values, if the env.
std::filesystem::path Path
void configureMixin(const nlohmann::json &json)
bool fileExists(const std::filesystem::path &p)
void writeDataToFile(const std::string &filename, const std::vector< unsigned char > &data) const
std::vector< std::filesystem::path > getAllFiles(const std::filesystem::path &p)
void ensureFullPathExists(bool createIfNotExistent=false) const
bool memoryBasePathExists() const