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

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

#include <windows/path.hpp>

Public Member Functions

 StringOrStringReference (std::reference_wrapper< const std::filesystem::path > path)
 Constructor for a reference to the n ative representation of a path.
 
template<std::convertible_to< std::wstring > String>
 StringOrStringReference (String &&string)
 Constructor for a string.
 
auto c_str () const noexcept -> const wchar_t *
 Gets the string as a null terminated string.
 
auto str () const &noexcept -> const std::wstring &
 Gets the string as an std::wstring.
 
auto str () &&noexcept -> std::wstring
 Gets the string as an std::wstring reference.
 

Detailed Description

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

Note
This class is only available under Windows

Constructor & Destructor Documentation

◆ StringOrStringReference() [1/2]

xentara::utils::windows::path::StringOrStringReference::StringOrStringReference ( std::reference_wrapper< const std::filesystem::path path)

Constructor for a reference to the n ative representation of a path.

Parameters
pathThe path to refer to. Must remain valid as long as this object exists.

◆ StringOrStringReference() [2/2]

template<std::convertible_to< std::wstring > String>
xentara::utils::windows::path::StringOrStringReference::StringOrStringReference ( String &&  string)

Constructor for a string.

Parameters
stringThe string

Member Function Documentation

◆ c_str()

auto xentara::utils::windows::path::StringOrStringReference::c_str ( ) const -> const wchar_t *
noexcept

Gets the string as a null terminated string.

◆ str() [1/2]

auto xentara::utils::windows::path::StringOrStringReference::str ( ) && -> std::wstring
noexcept

Gets the string as an std::wstring reference.

◆ str() [2/2]

auto xentara::utils::windows::path::StringOrStringReference::str ( ) const & -> const std::wstring &
noexcept

Gets the string as an std::wstring.