ADTF  3.18.4
workspace/conan/dev_essential/1.3.4/dw/stable/package/37682420cd166e229516a41c8d6a139a0b13e1e1/include/a_util/filesystem/filesystem.h File Reference

Public API for filesystem functions. More...

Go to the source code of this file.

Namespaces

 a_util
 Serves as the root component, with common functionality documented in core functionality.
 
 a_util::filesystem
 Serves as component for path and filesystem functionality.
 

Enumerations

enum  Error {
  OK , OPEN_FAILED , GENERAL_FAILURE , IO_ERROR ,
  INVALID_PATH , ACCESS_DENIED
}
 Enumerates possible error values for filesystem interaction. More...
 
enum  EnumDirFlags { ED_FILES = 0x1 , ED_DIRECTORIES = 0x2 }
 Enumeration for possible listings in a directory, usable in function enumDirectory() More...
 
enum class  DiffOptions : std::uint64_t { none = 0 }
 Available options for operations comparing files or directories. More...
 

Functions

Path getTempDirectory ()
 Retrieve path to the temp directory of the system. More...
 
Path getWorkingDirectory ()
 Retrieve path to the working directory of the current process. More...
 
Error setWorkingDirectory (const Path &path)
 Set the working directory. More...
 
Error readTextFile (const Path &file_path, std::string &content)
 Read entire content of a text file into a string. More...
 
Error readTextLines (const Path &file_path, std::vector< std::string > &vec_lines)
 Read entire content of a text file and split it every new line, dropping the EOL characters. More...
 
Error writeTextFile (const Path &file_path, const std::string &content)
 Open a file in mode 'w' and write new content to it. More...
 
Error enumDirectory (const Path &dir_path, std::vector< Path > &vec_entries, std::int32_t flags=ED_FILES|ED_DIRECTORIES)
 List all entries in a directory. More...
 
bool exists (const Path &path)
 Check whether the file or directory exists on the filesystem. More...
 
bool createDirectory (const Path &path)
 Create a new directory on the filesystem. More...
 
bool isFile (const Path &file_path)
 Check whether the path points to a file on the filesystem. More...
 
bool isDirectory (const Path &dir_path)
 Check whether the path points to a directory on the filesystem. More...
 
bool remove (const Path &path)
 Remove the file or directory pointed to by path. More...
 
bool rename (const Path &path, const Path &new_path)
 Rename or move a file or directory from path to new_path. More...
 
std::int64_t compareFiles (const Path &p1, const Path &p2)
 Compare content of two files. More...
 
std::int64_t compareFiles (const Path &p1, const Path &p2, DiffOptions options)
 Compare content of two files. More...
 

Detailed Description

Public API for filesystem functions.

Definition in file workspace/conan/dev_essential/1.3.4/dw/stable/package/37682420cd166e229516a41c8d6a139a0b13e1e1/include/a_util/filesystem/filesystem.h.