Functions | |
| fs::path | resolvePathFromEnvironment (const char *envVar, const string ¯o, std::optional< fs::path > defaultPath) |
| string | readFileToString (const string &path) |
| bool | canReadFile (const fs::path &filePath) |
| optional< unsigned > | findLineInFile (const string &searchedString, const string &path, string *lineContent) |
| vector< unsigned char > * | readFileToBytes (const string &path) |
| void | writeStringToFile (const string &outPath, const string &content) |
| void | writeBytesToFile (const string &outPath, const vector< unsigned char > &content) |
| void | collectPathsRecursively (const fs::path &fromDirectory, vector< fs::path > &collectedPaths, const vector< string > &allowedExtensions) |
| bool | isFileModifiedRecently (const fs::path &filePath, unsigned long long durationMillis) |
| bool | isParentDirectory (const fs::path &filePath, const fs::path &directoryPath) |
| optional< bool > | replaceLineInFile (const std::string &filePath, const std::string &searchedToken, const std::string &replacement) |
| fs::path | resolvePathFromEnvironment (const char *envVar, const string ¯o, optional< fs::path > defaultPath={}) |
| bool | hasExtension (const fs::path &filePath, const string &extension) |
| bool | hasAnyExtension (const fs::path &filePath, const vector< string > &extensions) |
| bool conscience_utils::file_system::canReadFile | ( | const fs::path & | filePath | ) |
| void conscience_utils::file_system::collectPathsRecursively | ( | const fs::path & | fromDirectory, |
| vector< fs::path > & | collectedPaths, | ||
| const vector< string > & | allowedExtensions = {} |
||
| ) |
| collectedPaths | paths will be collected recursively into this vector. It could be not empty |
| allowedExtensions | if empty, no filter will apply |
| optional< unsigned > conscience_utils::file_system::findLineInFile | ( | const string & | searchedString, |
| const string & | path, | ||
| string * | lineContent = nullptr |
||
| ) |
find first line number containing searchedString, or empty if not found
| lineContent | if pointer is not null, found line text will be provided at this pointer (if line is not found, nothing is done) |
|
inline |
|
inline |
| extension | can be prefixed with . or not, more efficient with dot |
| bool conscience_utils::file_system::isFileModifiedRecently | ( | const fs::path & | filePath, |
| unsigned long long | durationMillis | ||
| ) |
| bool conscience_utils::file_system::isParentDirectory | ( | const fs::path & | filePath, |
| const fs::path & | directoryPath | ||
| ) |
| vector< unsigned char > * conscience_utils::file_system::readFileToBytes | ( | const string & | path | ) |
| string conscience_utils::file_system::readFileToString | ( | const string & | path | ) |
reads UTF-8 file
| optional< bool > conscience_utils::file_system::replaceLineInFile | ( | const std::string & | filePath, |
| const std::string & | searchedToken, | ||
| const std::string & | replacement | ||
| ) |
| fs::path conscience_utils::file_system::resolvePathFromEnvironment | ( | const char * | envVar, |
| const string & | macro, | ||
| optional< fs::path > | defaultPath = {} |
||
| ) |
| fs::path conscience_utils::file_system::resolvePathFromEnvironment | ( | const char * | envVar, |
| const string & | macro, | ||
| std::optional< fs::path > | defaultPath | ||
| ) |
| void conscience_utils::file_system::writeBytesToFile | ( | const string & | outPath, |
| const vector< unsigned char > & | content | ||
| ) |
| void conscience_utils::file_system::writeStringToFile | ( | const string & | outPath, |
| const string & | content | ||
| ) |