Difference between revisions of "CXFilePath"

From cxwiki

(Created page with "<div class="mw-parser-output">The CXFilePath class provides an platform-neutral file path representation. The file paths are encoded in UTF8 with forward slash ("/") separator...")
(No difference)

Revision as of 19:20, 25 February 2018

The CXFilePath class provides an platform-neutral file path representation. The file paths are encoded in UTF8 with forward slash ("/") separators. A leading slash indicates an absolute path, otherwise the path is considered relative. The "/./" and "/../" constructs are supported for referring to the current directory and parent directory respectively. No other characters are reserved or prevented. CXFilePath objects are considered case sensitive, regardless of whether the underlying file system is or is not case sensitive.
 
The underlying CXFilePathBase templated class allows selection of a string container. CXFilePath is implemented as CXFilePathBase<CXString>. As an alternative, the application can use CXFilePathBase<CXStringEdit> instead of CXFilePath if high-performance editing is required.
 

Native Encodings

Where the host platform differs from these details, transformation between CXFilePath encoding and the native encoding occurs at the lowest possible level. The application should never need to deal with native encoding except where it is directly accessing native functions (bypassing the cxsource framework).
 

Windows

TBD.
C:\foo\bah.txt
C:\foo/bah.txt
\\machine\share\foo\bah.txt
\\?..
 

Posix

CXFilePath directly adopts posix filepath format and no significant transformations are required to convert between a posix file path and a CXFilePath. If the underlying APIs do not accept UTF-8 input, then a string codepage transformation may be required.
 

Methods