xentara-utils v1.2.1
Xentara utilities library
Loading...
Searching...
No Matches
xentara::utils::windows::path Namespace Reference

Filesystem path functionality. More...

Classes

class  StringOrStringReference
 A string that may or may not point to the internal buffer of a path. More...
 

Functions

auto toInternalPath (std::reference_wrapper< const std::filesystem::path > path) -> StringOrStringReference
 Converts a path to circumvent MAX_PATH length limitations.
 
template<std::convertible_to< std::wstring > String>
auto fromInternalPath (String &&path) -> std::wstring
 Converts a path from "\\?\" notation.
 
template<>
auto fromInternalPath (std::wstring &&path) -> std::wstring
 
template<>
auto fromInternalPath (std::string &&path) -> std::string
 

Detailed Description

Filesystem path functionality.

This namespace contains functionality realted to filesystem paths under Windows.

Function Documentation

◆ fromInternalPath() [1/3]

template<>
auto xentara::utils::windows::path::fromInternalPath ( std::string &&  path) -> std::string

◆ fromInternalPath() [2/3]

template<>
auto xentara::utils::windows::path::fromInternalPath ( std::wstring &&  path) -> std::wstring

◆ fromInternalPath() [3/3]

template<std::convertible_to< std::wstring > String>
auto xentara::utils::windows::path::fromInternalPath ( String &&  path) -> std::wstring

Converts a path from "\\?\" notation.

This Function remnoves superfluous "\\?\" from a path

Note
This function is only available under Windows
Parameters
pathThe path to convert
Returns
The converted path

◆ toInternalPath()

auto xentara::utils::windows::path::toInternalPath ( std::reference_wrapper< const std::filesystem::path path) -> StringOrStringReference

Converts a path to circumvent MAX_PATH length limitations.

This Function prepends "\\?\" to the path, if necessary. It also normalizes the path, because prepenbding "\?" disables the normalization of paths in Windows File API functions

Note
This function is only available under Windows
Parameters
pathThe path to convert
Returns
The converted path. The retuned value remains valid as long as path remains valid.