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 
8 
10 {
11  namespace filesystem::util
12  {
13  size_t getSizeOfDirectory(const std::filesystem::path& p);
14 
15  bool checkIfFolderInFilesystemExists(const std::filesystem::path& p);
16 
17  void ensureFolderInFilesystemExists(const std::filesystem::path& p, 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, const std::vector<unsigned char>& data);
24 
25  std::vector<unsigned char> readDataFromFilesystemFile(const std::filesystem::path path);
26 
27  std::vector<std::string> getAllFilesystemDirectories(const std::filesystem::path path);
28 
29  std::vector<std::string> getAllFilesystemFiles(const std::filesystem::path path);
30  }
31 } // namespace armarx::armem::server::ltm::disk
armarx::armem::server::ltm::disk::filesystem::util::readDataFromFilesystemFile
std::vector< unsigned char > readDataFromFilesystemFile(const std::filesystem::path path)
Definition: filesystem_util.cpp:84
armarx::armem::server::ltm::disk::filesystem::util::getAllFilesystemDirectories
std::vector< std::string > getAllFilesystemDirectories(const std::filesystem::path path)
Definition: filesystem_util.cpp:91
armarx::armem::server::ltm::disk::filesystem::util::checkIfFileInFilesystemExists
bool checkIfFileInFilesystemExists(const std::filesystem::path &p)
Definition: filesystem_util.cpp:58
armarx::armem::server::ltm::disk::filesystem::util::getSizeOfDirectory
size_t getSizeOfDirectory(const std::filesystem::path &p)
Definition: filesystem_util.cpp:12
data
uint8_t data[1]
Definition: EtherCATFrame.h:68
armarx::armem::server::ltm::disk::filesystem::util::writeDataInFilesystemFile
void writeDataInFilesystemFile(const std::filesystem::path &p, const std::vector< unsigned char > &data)
Definition: filesystem_util.cpp:72
armarx::armem::server::ltm::disk::filesystem::util::ensureFolderInFilesystemExists
void ensureFolderInFilesystemExists(const std::filesystem::path &p, bool createIfNotExistent)
Definition: filesystem_util.cpp:43
armarx::armem::server::ltm::disk::filesystem::util::checkIfFolderInFilesystemExists
bool checkIfFolderInFilesystemExists(const std::filesystem::path &p)
Definition: filesystem_util.cpp:38
armarx::armem::server::ltm::disk::filesystem::util::getAllFilesystemFiles
std::vector< std::string > getAllFilesystemFiles(const std::filesystem::path path)
Definition: filesystem_util.cpp:106
armarx::armem::server::ltm::disk
Definition: filesystem_util.cpp:8
armarx::armem::server::ltm::disk::filesystem::util::ensureFileInFilesystemExists
void ensureFileInFilesystemExists(const std::filesystem::path &p)
Definition: filesystem_util.cpp:63