filesystem_util.h
Go to the documentation of this file.
1#pragma once
2
3#include <filesystem>
4#include <fstream>
5#include <iostream>
6#include <vector>
7
9{
10 namespace filesystem::util
11 {
12 size_t getSizeOfDirectory(const std::filesystem::path& p);
13
14 bool checkIfFolderInFilesystemExists(const std::filesystem::path& p);
15
16 void ensureFolderInFilesystemExists(const std::filesystem::path& p,
17 bool createIfNotExistent = true);
18
19 bool checkIfFileInFilesystemExists(const std::filesystem::path& p);
20
21 void ensureFileInFilesystemExists(const std::filesystem::path& p);
22
23 void writeDataInFilesystemFile(const std::filesystem::path& p,
24 const std::vector<unsigned char>& data);
25
26 std::vector<unsigned char> readDataFromFilesystemFile(const std::filesystem::path path);
27
28 std::vector<std::string> getAllFilesystemDirectories(const std::filesystem::path path);
29
30 std::vector<std::string> getAllFilesystemFiles(const std::filesystem::path path);
31 } // namespace filesystem::util
32} // namespace armarx::armem::server::ltm::disk
void ensureFolderInFilesystemExists(const std::filesystem::path &p, bool createIfNotExistent)
std::vector< std::string > getAllFilesystemDirectories(const std::filesystem::path path)
std::vector< std::string > getAllFilesystemFiles(const std::filesystem::path path)
void ensureFileInFilesystemExists(const std::filesystem::path &p)
std::vector< unsigned char > readDataFromFilesystemFile(const std::filesystem::path path)
bool checkIfFileInFilesystemExists(const std::filesystem::path &p)
void writeDataInFilesystemFile(const std::filesystem::path &p, const std::vector< unsigned char > &data)
bool checkIfFolderInFilesystemExists(const std::filesystem::path &p)
size_t getSizeOfDirectory(const std::filesystem::path &p)