OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
openswmm::FilePathPair Struct Reference

Two-string carrier for any external file path that appears in a SWMM .inp file. More...

#include <FilePathPair.hpp>

Collaboration diagram for openswmm::FilePathPair:

Public Member Functions

 FilePathPair ()=default
 Create an empty authored token and empty resolved-path cache.
 
 FilePathPair (const FilePathPair &)=default
 Copy the authored token and resolved absolute cache from another pair.
 
 FilePathPair (FilePathPair &&) noexcept=default
 Move the authored token and resolved cache from another pair.
 
FilePathPair & operator= (const FilePathPair &)=default
 Copy both owned path strings from another pair.
 
FilePathPair & operator= (FilePathPair &&) noexcept=default
 Move both owned path strings from another pair.
 
 FilePathPair (const std::string &s)
 Copy a token into original and leave the resolved cache empty.
 
 FilePathPair (std::string &&s) noexcept
 Move a token into original and leave the resolved cache empty.
 
 FilePathPair (const char *s)
 Copy a token into original and leave the resolved cache empty.
 
FilePathPair & operator= (const std::string &s)
 Copy a new authored token and clear cached absolute resolution.
 
FilePathPair & operator= (std::string &&s) noexcept
 Move a new authored token and clear cached absolute resolution.
 
FilePathPair & operator= (const char *s)
 Copy a new authored token and clear cached absolute resolution.
 
 operator const std::string & () const noexcept
 Borrow the authored token through implicit string conversion.
 
bool empty () const noexcept
 Test whether the authored token is empty.
 
std::size_t size () const noexcept
 Count bytes in the authored token.
 
const char * c_str () const noexcept
 Borrow a NUL-terminated view of the authored token.
 
const std::string & str () const noexcept
 Borrow the complete authored token.
 

Public Attributes

std::string absolute
 
std::string original
 

Friends

bool operator== (const FilePathPair &a, const FilePathPair &b)
 Compare authored tokens for exact-byte equality.
 
bool operator!= (const FilePathPair &a, const FilePathPair &b)
 Compare authored tokens for exact-byte inequality.
 
bool operator== (const FilePathPair &a, const std::string &s)
 Compare authored tokens for exact-byte equality.
 
bool operator== (const std::string &s, const FilePathPair &a)
 Compare authored tokens for exact-byte equality.
 
bool operator!= (const FilePathPair &a, const std::string &s)
 Compare authored tokens for exact-byte inequality.
 
bool operator!= (const std::string &s, const FilePathPair &a)
 Compare authored tokens for exact-byte inequality.
 
bool operator== (const FilePathPair &a, const char *s)
 Compare authored tokens for exact-byte equality.
 
bool operator== (const char *s, const FilePathPair &a)
 Compare authored tokens for exact-byte equality.
 
bool operator!= (const FilePathPair &a, const char *s)
 Compare authored tokens for exact-byte inequality.
 
bool operator!= (const char *s, const FilePathPair &a)
 Compare authored tokens for exact-byte inequality.
 

Detailed Description

Two-string carrier for any external file path that appears in a SWMM .inp file.

Each slot carries:

  • absolute: resolved absolute path, ready for fopen(). Filled by PostParseResolver after read; empty for programmatic models until a path-set call runs.
  • original: verbatim token as it appeared in the source .inp file (relative or absolute, with whichever separators the author used). Empty for models that were not loaded from an .inp.

Slice IO-2 keeps every existing caller working through an implicit std::string surface that targets original. Slice IO-3 wires PostParseResolver to populate absolute; Slice IO-4 wires the writer to rebase original against the destination directory.

Constructor & Destructor Documentation

◆ FilePathPair() [1/6]

openswmm::FilePathPair::FilePathPair ( )
default

Create an empty authored token and empty resolved-path cache.

Here is the caller graph for this function:

◆ FilePathPair() [2/6]

openswmm::FilePathPair::FilePathPair ( const FilePathPair & )
default

Copy the authored token and resolved absolute cache from another pair.

Both strings become independently owned copies; no path resolution or filesystem access occurs.

Here is the call graph for this function:

◆ FilePathPair() [3/6]

openswmm::FilePathPair::FilePathPair ( FilePathPair && )
defaultnoexcept

Move the authored token and resolved cache from another pair.

Source remains valid with unspecified string contents. Does not resolve/check either path.

Here is the call graph for this function:

◆ FilePathPair() [4/6]

openswmm::FilePathPair::FilePathPair ( const std::string & s)
inline

Copy a token into original and leave the resolved cache empty.

Does not resolve, normalize, validate or open the path.

Parameters
[in]sBorrowed authored path token, copied verbatim including embedded NUL bytes.
Here is the call graph for this function:

◆ FilePathPair() [5/6]

openswmm::FilePathPair::FilePathPair ( std::string && s)
inlinenoexcept

Move a token into original and leave the resolved cache empty.

Does not resolve, normalize, validate or open the path.

Parameters
[in]sToken moved into original; source remains valid with unspecified contents.

◆ FilePathPair() [6/6]

openswmm::FilePathPair::FilePathPair ( const char * s)
inline

Copy a token into original and leave the resolved cache empty.

Does not resolve, normalize, validate or open the path.

Parameters
[in]sBorrowed NUL-terminated token; NULL is treated as empty.

Member Function Documentation

◆ c_str()

const char * openswmm::FilePathPair::c_str ( ) const
inlinenodiscardnoexcept

Borrow a NUL-terminated view of the authored token.

Returns
original.c_str(); do not free, and copy before token modification or pair destruction.

◆ empty()

bool openswmm::FilePathPair::empty ( ) const
inlinenodiscardnoexcept

Test whether the authored token is empty.

Returns
original.empty(); ignores whether absolute has been populated.
Here is the caller graph for this function:

◆ operator const std::string &()

openswmm::FilePathPair::operator const std::string & ( ) const
inlinenoexcept

Borrow the authored token through implicit string conversion.

Returns
Reference to original, not absolute; valid until token modification or pair destruction.

◆ operator=() [1/5]

FilePathPair & openswmm::FilePathPair::operator= ( const char * s)
inline

Copy a new authored token and clear cached absolute resolution.

Caller must resolve the new token explicitly before relying on absolute.

Parameters
[in]sBorrowed NUL-terminated token; NULL is treated as empty.
Returns
Reference to this pair; previous borrowed token/cache views may be invalidated.
Here is the call graph for this function:

◆ operator=() [2/5]

FilePathPair & openswmm::FilePathPair::operator= ( const FilePathPair & )
default

Copy both owned path strings from another pair.

Returns
Reference to this pair; old string views may be invalidated.
Here is the call graph for this function:

◆ operator=() [3/5]

FilePathPair & openswmm::FilePathPair::operator= ( const std::string & s)
inline

Copy a new authored token and clear cached absolute resolution.

Caller must resolve the new token explicitly before relying on absolute.

Parameters
[in]sBorrowed authored path token, copied verbatim including embedded NUL bytes.
Returns
Reference to this pair; previous borrowed token/cache views may be invalidated.
Here is the call graph for this function:

◆ operator=() [4/5]

FilePathPair & openswmm::FilePathPair::operator= ( FilePathPair && )
defaultnoexcept

Move both owned path strings from another pair.

Returns
Reference to this pair; source remains valid with unspecified string contents.
Here is the call graph for this function:

◆ operator=() [5/5]

FilePathPair & openswmm::FilePathPair::operator= ( std::string && s)
inlinenoexcept

Move a new authored token and clear cached absolute resolution.

Caller must resolve the new token explicitly before relying on absolute.

Parameters
[in]sToken moved into original; source remains valid with unspecified contents.
Returns
Reference to this pair; previous borrowed token/cache views may be invalidated.
Here is the call graph for this function:

◆ size()

std::size_t openswmm::FilePathPair::size ( ) const
inlinenodiscardnoexcept

Count bytes in the authored token.

Returns
original.size(), excluding the terminating NUL and including any embedded NUL bytes.

◆ str()

const std::string & openswmm::FilePathPair::str ( ) const
inlinenodiscardnoexcept

Borrow the complete authored token.

Returns
Reference to original; absolute cache is not consulted.

Friends And Related Symbol Documentation

◆ operator!= [1/5]

bool operator!= ( const char * s,
const FilePathPair & a )
friend

Compare authored tokens for exact-byte inequality.

No case folding, path normalization, filesystem lookup or resolved-cache comparison is performed.

Parameters
[in]sBorrowed NUL-terminated token; NULL compares as the empty token.
[in]aBorrowed pair; only original participates, never absolute.
Returns
True when the authored tokens are different.

◆ operator!= [2/5]

bool operator!= ( const FilePathPair & a,
const char * s )
friend

Compare authored tokens for exact-byte inequality.

No case folding, path normalization, filesystem lookup or resolved-cache comparison is performed.

Parameters
[in]aBorrowed pair; only original participates, never absolute.
[in]sBorrowed NUL-terminated token; NULL compares as the empty token.
Returns
True when the authored tokens are different.

◆ operator!= [3/5]

bool operator!= ( const FilePathPair & a,
const FilePathPair & b )
friend

Compare authored tokens for exact-byte inequality.

No case folding, path normalization, filesystem lookup or resolved-cache comparison is performed.

Parameters
[in]aBorrowed pair; only original participates, never absolute.
[in]bBorrowed pair; only original participates, never absolute.
Returns
True when the authored tokens are different.

◆ operator!= [4/5]

bool operator!= ( const FilePathPair & a,
const std::string & s )
friend

Compare authored tokens for exact-byte inequality.

No case folding, path normalization, filesystem lookup or resolved-cache comparison is performed.

Parameters
[in]aBorrowed pair; only original participates, never absolute.
[in]sBorrowed exact-byte token, including embedded NUL bytes.
Returns
True when the authored tokens are different.

◆ operator!= [5/5]

bool operator!= ( const std::string & s,
const FilePathPair & a )
friend

Compare authored tokens for exact-byte inequality.

No case folding, path normalization, filesystem lookup or resolved-cache comparison is performed.

Parameters
[in]sBorrowed exact-byte token, including embedded NUL bytes.
[in]aBorrowed pair; only original participates, never absolute.
Returns
True when the authored tokens are different.

◆ operator== [1/5]

bool operator== ( const char * s,
const FilePathPair & a )
friend

Compare authored tokens for exact-byte equality.

No case folding, path normalization, filesystem lookup or resolved-cache comparison is performed.

Parameters
[in]sBorrowed NUL-terminated token; NULL compares as the empty token.
[in]aBorrowed pair; only original participates, never absolute.
Returns
True when the authored tokens are equal.

◆ operator== [2/5]

bool operator== ( const FilePathPair & a,
const char * s )
friend

Compare authored tokens for exact-byte equality.

No case folding, path normalization, filesystem lookup or resolved-cache comparison is performed.

Parameters
[in]aBorrowed pair; only original participates, never absolute.
[in]sBorrowed NUL-terminated token; NULL compares as the empty token.
Returns
True when the authored tokens are equal.

◆ operator== [3/5]

bool operator== ( const FilePathPair & a,
const FilePathPair & b )
friend

Compare authored tokens for exact-byte equality.

No case folding, path normalization, filesystem lookup or resolved-cache comparison is performed.

Parameters
[in]aBorrowed pair; only original participates, never absolute.
[in]bBorrowed pair; only original participates, never absolute.
Returns
True when the authored tokens are equal.

◆ operator== [4/5]

bool operator== ( const FilePathPair & a,
const std::string & s )
friend

Compare authored tokens for exact-byte equality.

No case folding, path normalization, filesystem lookup or resolved-cache comparison is performed.

Parameters
[in]aBorrowed pair; only original participates, never absolute.
[in]sBorrowed exact-byte token, including embedded NUL bytes.
Returns
True when the authored tokens are equal.

◆ operator== [5/5]

bool operator== ( const std::string & s,
const FilePathPair & a )
friend

Compare authored tokens for exact-byte equality.

No case folding, path normalization, filesystem lookup or resolved-cache comparison is performed.

Parameters
[in]sBorrowed exact-byte token, including embedded NUL bytes.
[in]aBorrowed pair; only original participates, never absolute.
Returns
True when the authored tokens are equal.

Member Data Documentation

◆ absolute

std::string openswmm::FilePathPair::absolute

◆ original

std::string openswmm::FilePathPair::original

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