Class with util functions to work with files.
More...
#include <FileUtils.h>
|
static std::vector< std::string > | handleFilePath (std::map< std::string, ObjectT > ¶ms) |
| Handle the filepath or efilepath argument from a map of parameters in the context of geometry loading. More...
|
|
static std::vector< std::string > | getFilesByExpression (std::string const pathExpression) |
| Obtain the files which are referenced by the path expression. More...
|
|
static void | unzipFile (std::string const inputPath, std::string const outputPath) |
| Decompress a file generated through ZipSyncFileWriter. More...
|
|
static void | extractExtensionAndPathWithoutExtension (std::string const &path, std::string &ext, std::string &pathNonExt) |
| Extract the extension and the path without extension from given path with extension. More...
|
|
static std::string | craftPathWithSuffix (std::string const &pathNonExt, std::string const &suffix, std::string const &ext) |
| Build a string such that: builtString = pathNonExt + suffix + ext. More...
|
|
Class with util functions to work with files.
- Author
- Alberto M. Esmoris Pena
- Version
- 1.0
◆ craftPathWithSuffix()
std::string FileUtils::craftPathWithSuffix |
( |
std::string const & |
pathNonExt, |
|
|
std::string const & |
suffix, |
|
|
std::string const & |
ext |
|
) |
| |
|
static |
Build a string such that: builtString = pathNonExt + suffix + ext.
- Parameters
-
pathNonExt | The path without extension |
suffix | The suffix to be appended to the path without extension |
ext | The extension to be appended after the suffix |
- Returns
- Built string : pathNonExt + suffix + ext
◆ extractExtensionAndPathWithoutExtension()
void FileUtils::extractExtensionAndPathWithoutExtension |
( |
std::string const & |
path, |
|
|
std::string & |
ext, |
|
|
std::string & |
pathNonExt |
|
) |
| |
|
static |
Extract the extension and the path without extension from given path with extension.
- Parameters
-
[in] | path | The patch which extension must be extracted |
[out] | ext | Where the extracted extension will be stored |
[out] | pathNonExt | Where the path without extension will be stored |
◆ getFilesByExpression()
std::vector< std::string > FileUtils::getFilesByExpression |
( |
std::string const |
pathExpression | ) |
|
|
static |
Obtain the files which are referenced by the path expression.
For instance, the expression "/tmp/heat.*data.csv" would obtain all files in /tmp/ directory which start by "heat" and end by "data.csv"
Another example, using expression "/home/helios/sceneparts/.*\.obj" would obtain all files in "/home/helios/sceneparts/" which end by ".obj"
- Parameters
-
pathExpression | The path expression itself. For instance "/tmp/.*\.csv" |
◆ handleFilePath()
std::vector< std::string > FileUtils::handleFilePath |
( |
std::map< std::string, ObjectT > & |
params | ) |
|
|
static |
Handle the filepath or efilepath argument from a map of parameters in the context of geometry loading.
- Parameters
-
params | Map of parameters defining the geometry loading process |
- Returns
- Vector of parsed file paths (1 for filepath, n for efilepath)
◆ unzipFile()
void FileUtils::unzipFile |
( |
std::string const |
inputPath, |
|
|
std::string const |
outputPath |
|
) |
| |
|
static |
Decompress a file generated through ZipSyncFileWriter.
- Parameters
-
inputPath | Path to the compressed file to be decompressed |
outputPath | Path where the decompressed file will be written |
- See also
- ZipSyncFileWriter
◆ pathSeparator
char const FileUtils::pathSeparator |
|
static |
Initial value:
Path separator constant.
The documentation for this class was generated from the following files:
- src/filems/util/FileUtils.h
- src/filems/util/FileUtils.cpp