◆ addExtensionIfNeeded()
static std::string vcl::FileInfo::addExtensionIfNeeded |
( |
const std::string & |
filename, |
|
|
const std::string & |
ext |
|
) |
| |
|
inlinestatic |
Adds an extension to a file name if it doesn't already have it.
- Parameters
-
[in] | filename | The file name to add the extension to. |
[in] | ext | The extension to add to the file name. |
- Returns
- The file name with the extension added.
◆ exists()
Check if a file exists.
- Parameters
-
[in] | filename | string containing the filename |
- Returns
- true if the file exists, false otherwise
◆ extension()
static std::string vcl::FileInfo::extension |
( |
const std::string & |
filename | ) |
|
|
inlinestatic |
Get the extension of a file.
Example of usage:
std::string
fullname =
"/usr/bin/foo.sh";
static std::string extension(const std::string &filename)
Get the extension of a file.
Definition file_info.h:257
A class representing a line segment in n-dimensional space. The class is parameterized by a PointConc...
Definition segment.h:43
- Parameters
-
[in] | filename | string containing the filename |
- Returns
- the extension of the file
◆ fileNameWithExtension()
static std::string vcl::FileInfo::fileNameWithExtension |
( |
const std::string & |
fullpath | ) |
|
|
inlinestatic |
Get the filename with extension of a file.
Example of usage:
std::string
fullname =
"/usr/bin/foo.sh";
static std::string fileNameWithExtension(const std::string &fullpath)
Get the filename with extension of a file.
Definition file_info.h:237
- Parameters
-
[in] | fullpath | string containing the full path of the file |
- Returns
- the filename with extension of the file
◆ fileNameWithoutExtension()
static std::string vcl::FileInfo::fileNameWithoutExtension |
( |
const std::string & |
fullpath | ) |
|
|
inlinestatic |
Get the file name without extension of a file.
Example of usage:
std::string
fullname =
"/usr/bin/foo.sh";
static std::string fileNameWithoutExtension(const std::string &fullpath)
Get the file name without extension of a file.
Definition file_info.h:217
- Parameters
-
[in] | fullpath | string containing the full path of the file |
- Returns
- the filename without extension of the file
◆ fileSize()
static std::size_t vcl::FileInfo::fileSize |
( |
const std::string & |
filename | ) |
|
|
inlinestatic |
Get the size of a file.
- Parameters
-
[in] | filename | string containing the filename |
- Returns
- the size of the file in bytes
◆ isFileBinary()
Check if a file is binary.
The function checks the first 1000 bytes of the file. If a single byte is not an ASCII character (i.e., its value is greater than 127), the file is considered binary.
- Parameters
-
[in] | filename | string containing the filename |
- Returns
- true if the file is binary, false otherwise
- Exceptions
-
◆ pathWithoutFileName()
static std::string vcl::FileInfo::pathWithoutFileName |
( |
const std::string & |
fullpath | ) |
|
|
inlinestatic |
Get the path of a file.
Example of usage:
std::string
fullname =
"/usr/bin/foo.sh";
static std::string pathWithoutFileName(const std::string &fullpath)
Get the path of a file.
Definition file_info.h:197
- Parameters
-
[in] | fullpath | string containing the full path of the file |
- Returns
- the path of the file
◆ separateExtensionFromFileName()
static void vcl::FileInfo::separateExtensionFromFileName |
( |
const std::string & |
fullname, |
|
|
std::string & |
rawName, |
|
|
std::string & |
extension |
|
) |
| |
|
inlinestatic |
Extracts the extension of a string that contains a filename.
Example of usage:
std::string
fullname =
"/usr/bin/foo.sh";
static void separateExtensionFromFileName(const std::string &fullname, std::string &rawName, std::string &extension)
Extracts the extension of a string that contains a filename.
Definition file_info.h:134
To separate the path from the filename, see FileInfo::separateFilenameFromPath
- Parameters
-
[in] | fullname | string containing the filename |
[out] | rawName | output string containing the filename without the extension |
[out] | extension | output string containing the extension of the filename |
◆ separateFileNameFromPath()
static void vcl::FileInfo::separateFileNameFromPath |
( |
const std::string & |
fullpath, |
|
|
std::string & |
path, |
|
|
std::string & |
filename |
|
) |
| |
|
inlinestatic |
Extracts the filename (extension included) of a string that contains a fullpath.
Example of usage:
std::string
fullname =
"/usr/bin/foo.sh";
- Parameters
-
[in] | fullpath | string containing the fullpath |
[out] | path | output string containing the path of the file |
[out] | filename | output string containing the filename (extension included) |
The documentation for this class was generated from the following file: