xentara-utils v2.0.4
The Xentara Utility 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 > WString>
auto fromInternalPath (WString &&path) -> std::wstring
 Converts a path from "\\?\" notation.
 
template<std::convertible_to< std::string > String>
auto fromInternalPath (String &&path) -> std::string
 Converts a path from "\\?\" notation.
 
template<std::convertible_to< std::wstring > WString>
internal auto fromInternalPath (WString &&path) -> std::wstring
 Converts a path from "\\?\" notation.
 

Detailed Description

Filesystem path functionality.

This namespace contains functionality realted to filesystem paths under Windows.

Function Documentation

◆ fromInternalPath() [1/3]

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

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

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

Note
This function is only available under Windows
Include file
#include <xentara/utils/windows/path.hpp>
Parameters
pathThe path to convert
Returns
The converted path

◆ fromInternalPath() [2/3]

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

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

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

Note
This function is only available under Windows
Include file
#include <xentara/utils/windows/path.hpp>
Parameters
pathThe path to convert
Returns
The converted path

◆ fromInternalPath() [3/3]

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

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

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

Note
This function is only available under Windows
Include file
#include <xentara/utils/windows/path.hpp>
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
Include file
#include <xentara/utils/windows/path.hpp>
Parameters
pathThe path to convert
Returns
The converted path. The retuned value remains valid as long as path remains valid.