wavelength 1.0.0
Loading...
Searching...
No Matches
FilePath Class Reference

Path of a file, kept relative to a shared root directory. More...

#include <filepath.h>

Inheritance diagram for FilePath:
Collaboration diagram for FilePath:

Public Member Functions

 ~FilePath () override=default
 Destroy the object.
void Set (const char *pszPath)
 Set the path, resolving a relative path against the root directory.
const char * RelativePath () const
 Report the path relative to the root directory.
Public Member Functions inherited from String
 String ()
 Construct an empty string.
 String (const char *pszText)
 Construct a copy of a C string.
 String (const String &other)
 Copy another string.
 ~String () override
 Release the text.
void Print (const char *pszText) override
 Append text.
String & operator= (const String &other)
 Replace the text with a copy of another string's text.
String & operator= (const char *pszText)
 Replace the text with a copy of a C string.
String & Clear ()
 Release the text and leave the string empty.
char operator[] (int nIndex) const
 Report one character.
String & Replace (int nPos, int nCount, const String &text)
 Replace a run of characters with another string's text.
String & Truncate (int nLength)
 Cut the text to a length.
String & Erase (int nPos, int nCount)
 Remove a run of characters.
String & operator+= (const String &other)
 Append another string's text.
String & operator+= (const char *pszText)
 Append a C string.
String & operator+= (char ch)
 Append a character.
int Compare (int nPos, int nCount, const char *pszText) const
 Compare a run of characters with a C string.
int Find (const char *pszText) const
 Find the first occurrence of a C string in the text.
int Find (char ch) const
 Find the first occurrence of a character.
int Find (char ch, int nPos) const
 Find the first occurrence of a character at or after a position.
int RFind (char ch) const
 Find the last occurrence of a character.
String Substring (int nPos) const
 Copy the characters from a position to the end.
String Substring (int nPos, int nCount) const
 Copy a run of characters, or the characters from a position to the end when the run reaches the end.
String & Insert (int nPos, int nCount, char ch)
 Insert copies of one character.
String & Insert (int nPos, const String &text)
 Insert a copy of another string's text.
bool operator< (const String &other) const
 Report whether the text sorts before another string's text.
bool operator== (const char *pszText) const
 Report whether the text equals a C string.
bool operator== (const String &other) const
 Report whether the text equals another string's text.
bool operator!= (const char *pszText) const
 Report whether the text differs from a C string.
bool operator!= (const String &other) const
 Report whether the text differs from another string's text.
String operator+ (const char *pszText) const
 Report a copy of the string with text appended.
String operator+ (char ch) const
 Report a copy of the string with a character appended.
String operator+ (const String &other) const
 Report a copy of the string with another string's text appended.
void Resize (int nLength)
 Replace the text with nLength zero bytes.
const char * c_str () const
 Report the text.
int GetLength () const
char * GetBuffer () const
 String ()
 String (const char *str)
 Copy text.
 String (const String &other)
 Copy another String.
virtual ~String ()
 Free the buffer.
virtual void Print (const char *str)
 Append printed text.
String & operator+= (const String &other)
 Append another String.
String & operator+= (const char *str)
 Append text.
String & operator= (const char *str)
 Replace the text.
String & operator= (const String &other)
 Replace the text with a copy of another String.
bool operator!= (const char *str) const
 Compare with text.
bool operator!= (const String &other) const
 Compare with another String.
bool operator== (const char *str) const
 Compare with text.
bool operator== (const String &other) const
 Compare with another String.
bool operator< (const String &other) const
 Order by the bytes of the text.
void Resize (unsigned int length)
 Replace the text with a length of zero bytes.
int Find (const char *str) const
 Find the first occurrence of text.
int FindLast (char c) const
 Find the last occurrence of a character.
String Substring (unsigned int pos) const
 Copy the text from a position to the end.
String Substring (unsigned int pos, unsigned int count) const
 Copy part of the text.
String & Replace (unsigned int pos, unsigned int count, const String &str)
 Replace part of the text with another String.
String & Clear ()
 Empty the String.
const char * c_str () const
 operator const char * () const
unsigned int size () const
Public Member Functions inherited from PrnStream
 PrnStream ()
 Construct a stream with a dump level of 0.
virtual ~PrnStream ()
 Release the stream.
void Printf (const char *pszFormat,...)
 Format text into the shared format buffer and write the result through Print().
PrnStream & operator<< (const char *pszText)
 Write text.
PrnStream & operator<< (char ch)
 Write a character.
PrnStream & operator<< (short nValue)
 Write a short integer in decimal.
PrnStream & operator<< (int nValue)
 Write an integer in decimal.
PrnStream & operator<< (unsigned char nValue)
 Write a byte as an unsigned integer in decimal.
PrnStream & operator<< (unsigned short nValue)
 Write an unsigned short integer in decimal.
PrnStream & operator<< (unsigned int nValue)
 Write an unsigned integer in decimal.
PrnStream & operator<< (unsigned long long nValue)
 Write an unsigned 64-bit number in decimal.
PrnStream & operator<< (float fValue)
 Write a number with two decimals.
PrnStream & operator<< (bool bValue)
 Write true or false.
void Space (int nCount)
 Write a number of spaces, one Print() call each.
int GetDumpLevel () const
 PrnStream ()
virtual ~PrnStream ()
 Destroy the stream.
void Printf (const char *format,...)
 Format text with printf() conventions and write it.
PrnStream & operator<< (char c)
 Write a character.
PrnStream & operator<< (int i)
 Write an integer in decimal.
PrnStream & operator<< (float f)
 Write a number with two decimal places.
PrnStream & operator<< (const char *str)
 Write text.
void Space (int count)
 Write spaces.

Static Public Member Functions

static void SetRoot (const char *pszRoot)
 Set the root directory that relative paths resolve against.

Static Public Attributes

static String sRoot
 The root directory that relative paths resolve against, .
Static Public Attributes inherited from String
static constexpr int npos = -1
 The position Find() reports when the text does not occur.

Additional Inherited Members

Public Types inherited from String
enum  { npos = -1 }
 The result of a search that finds nothing. More...

Detailed Description

Path of a file, kept relative to a shared root directory.

The RTTI records the class as deriving from String, and the class adds no member. The vtable is at 0x003cc948.

Constructor & Destructor Documentation

◆ ~FilePath()

FilePath::~FilePath ( )
overridedefault

Destroy the object.

Ghidra address:
NTSC-U/C: 0x00357028
Ghidra address:
PAL: 0x003c4288

Member Function Documentation

◆ SetRoot()

void FilePath::SetRoot ( const char * pszRoot)
static

Set the root directory that relative paths resolve against.

An absolute path replaces the root. A relative one is appended to the current root.

Parameters
pszRootThe directory.
Ghidra address:
NTSC-U/C: 0x002993b8
Ghidra address:
PAL: 0x002a2fc8

◆ Set()

void FilePath::Set ( const char * pszPath)

Set the path, resolving a relative path against the root directory.

Parameters
pszPathThe path.
Ghidra address:
NTSC-U/C: 0x00299448
Ghidra address:
PAL: 0x002a3058

◆ RelativePath()

const char * FilePath::RelativePath ( ) const

Report the path relative to the root directory.

The name is inferred.

Returns
The path.
Ghidra address:
NTSC-U/C: 0x002994d0
Ghidra address:
PAL: 0x002a30e0

Member Data Documentation

◆ sRoot

String FilePath::sRoot
static

The root directory that relative paths resolve against, .

until SetRoot() runs.

One routine at 0x002994f8 constructs and destroys it, called by the static construction and destruction entries at 0x00299548 and 0x00299568.

Ghidra address:
NTSC-U/C: 0x00515318

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