Utility class providing static helpers for extracting components from filesystem paths.
More...
#include <PathHelper.h>
|
| static std::string | GetFileName (const fs::path &input) |
| | Returns the filename component of a path (including extension).
|
| |
| static std::string | GetFileNameWithoutExtension (const fs::path &input) |
| | Returns the filename without its extension (stem).
|
| |
| static std::string | GetFileNameExtension (const std::string &input) |
| | Returns the file extension including the leading dot.
|
| |
| static fs::path | GetPath (const std::string &input) |
| | Extracts the directory portion of a slash-separated path, stripping segments that contain a dot.
|
| |
| static fs::path | GetDirectoryName (const fs::path &path) |
| | Returns the parent directory of the given path.
|
| |
Utility class providing static helpers for extracting components from filesystem paths.
Equivalent to Path but lives inside the Ship namespace.
◆ GetDirectoryName()
| static fs::path Ship::PathHelper::GetDirectoryName |
( |
const fs::path & |
path | ) |
|
|
inlinestatic |
Returns the parent directory of the given path.
- Parameters
-
- Returns
- Parent directory path.
◆ GetFileName()
| static std::string Ship::PathHelper::GetFileName |
( |
const fs::path & |
input | ) |
|
|
inlinestatic |
Returns the filename component of a path (including extension).
- Parameters
-
- Returns
- Filename string (e.g. "file.txt" from "/dir/file.txt").
◆ GetFileNameExtension()
| static std::string Ship::PathHelper::GetFileNameExtension |
( |
const std::string & |
input | ) |
|
|
inlinestatic |
Returns the file extension including the leading dot.
- Parameters
-
| input | File path or name as a string. |
- Returns
- Extension string (e.g. ".txt").
- Exceptions
-
| std::out_of_range | if input contains no '.' character. |
◆ GetFileNameWithoutExtension()
| static std::string Ship::PathHelper::GetFileNameWithoutExtension |
( |
const fs::path & |
input | ) |
|
|
inlinestatic |
Returns the filename without its extension (stem).
- Parameters
-
- Returns
- Stem string (e.g. "file" from "/dir/file.txt").
◆ GetPath()
| static fs::path Ship::PathHelper::GetPath |
( |
const std::string & |
input | ) |
|
|
inlinestatic |
Extracts the directory portion of a slash-separated path, stripping segments that contain a dot.
- Parameters
-
| input | Slash-separated path string. |
- Returns
- Filesystem path composed of only the directory segments.
The documentation for this class was generated from the following file: