libultraship
Reimplementations of libultra (N64 SDK) functions for modern hardware
Loading...
Searching...
No Matches
Ship::PathHelper Class Reference

Utility class providing static helpers for extracting components from filesystem paths. More...

#include <PathHelper.h>

Static Public Member Functions

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.
 

Detailed Description

Utility class providing static helpers for extracting components from filesystem paths.

Equivalent to Path but lives inside the Ship namespace.

Member Function Documentation

◆ GetDirectoryName()

static fs::path Ship::PathHelper::GetDirectoryName ( const fs::path &  path)
inlinestatic

Returns the parent directory of the given path.

Parameters
pathFilesystem path.
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
inputFilesystem path.
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
inputFile path or name as a string.
Returns
Extension string (e.g. ".txt").
Exceptions
std::out_of_rangeif input contains no '.' character.

◆ GetFileNameWithoutExtension()

static std::string Ship::PathHelper::GetFileNameWithoutExtension ( const fs::path &  input)
inlinestatic

Returns the filename without its extension (stem).

Parameters
inputFilesystem path.
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
inputSlash-separated path string.
Returns
Filesystem path composed of only the directory segments.

The documentation for this class was generated from the following file: