13 for (
char const& ch :
s)
15 if (std::isdigit(ch) == 0)
25 if (mPath.extension() == minizip::util::MINIZIP_SUFFIX)
27 return minizip::util::checkZipFile(mPath);
34 if (mPath.extension() == minizip::util::MINIZIP_SUFFIX)
36 auto z = minizip::util::ensureZipFile(mPath, createIfNotExistent);
45 if (mPath.extension() == minizip::util::MINIZIP_SUFFIX)
47 return minizip::util::checkIfFolderInZipExists(mPath, p);
53 void ensureFolderExists(
const std::filesystem::path& mPath,
const std::filesystem::path& p,
bool createIfNotExistent)
55 if (mPath.extension() == minizip::util::MINIZIP_SUFFIX)
57 return minizip::util::ensureFolderInZipExists(mPath, p, createIfNotExistent);
65 if (mPath.extension() == minizip::util::MINIZIP_SUFFIX)
67 return minizip::util::checkIfFileInZipExists(mPath, p);
73 void ensureFileExists(
const std::filesystem::path& mPath,
const std::filesystem::path& p)
75 if (mPath.extension() == minizip::util::MINIZIP_SUFFIX)
77 return minizip::util::ensureFileInZipExists(mPath, p);
83 void writeDataToFile(
const std::filesystem::path& mPath,
const std::filesystem::path& p,
const std::vector<unsigned char>&
data)
85 if (mPath.extension() == minizip::util::MINIZIP_SUFFIX)
87 return minizip::util::writeDataInFileInZipFile(mPath, p,
data);
93 void writeDataToFileRepeated(
const std::filesystem::path& mPath,
const std::filesystem::path& p,
const std::vector<unsigned char>&
data,
const unsigned int maxTries,
const unsigned int sleepTimeMs)
95 for (
unsigned int i = 0; i < maxTries; ++i)
105 std::this_thread::sleep_for(std::chrono::milliseconds(sleepTimeMs));
110 throw error::ArMemError(
"ATTENTION! Even after " +
std::to_string(maxTries) +
" tries, the memory was not able to store the instance at path '" + p.string() +
"'. This means this instance will be lost!");
113 std::vector<unsigned char>
readDataFromFile(
const std::filesystem::path& mPath,
const std::filesystem::path& p)
115 if (mPath.extension() == minizip::util::MINIZIP_SUFFIX)
117 return minizip::util::readDataFromFileInZipFile(mPath, p);
123 std::vector<std::string>
getAllDirectories(
const std::filesystem::path& mPath,
const std::filesystem::path& p)
125 if (mPath.extension() == minizip::util::MINIZIP_SUFFIX)
133 std::vector<std::string>
getAllFiles(
const std::filesystem::path& mPath,
const std::filesystem::path& p)
135 if (mPath.extension() == minizip::util::MINIZIP_SUFFIX)