std::filesystem::path::generic_string, std::filesystem::path::generic_wstring, std::filesystem::path::generic_u8string

template< class CharT, class Traits = std::char_traits<CharT>,

          class Alloc = std::allocator<CharT> >
std::basic_string<CharT,Traits,Alloc>

    generic_string( const Alloc& a = Alloc() ) const;
(1) (C++17 起)
(2) (C++17 起)
std::string generic_string() const;
std::wstring generic_wstring() const;
std::string generic_u8string() const;
std::u16string generic_u16string() const;
std::u32string generic_u32string() const;

返回通用路径名格式的内部路径名,转换到指定的字符串格式。若存在转换,则按下列方式进行:

/ 字符为作目录分隔符。

1) 所有内存分配由 a 进行。
2) u8string() 情形下结果的编码始终是 UTF-8 。

目录

参数

a - 构造字符串用的分配器
类型要求
-
CharT 必须是编码字符类型之一( charwchar_tchar16_tchar32_t

返回值

通用路径名格式的内部路径名,转换到指定的字符串类型。

异常

(无)

参阅

返回转换到字符串的原生路径名格式
(公开成员函数)

版本历史

  • (当前 | 先前 2017年12月7日 (四) 04:45D41D8CD98F讨论 | 贡献 . . (1,510字节) (0). . (撤销)
  • 当前 | 先前 2017年12月7日 (四) 04:44D41D8CD98F讨论 | 贡献. . (1,510字节) (-7). . (撤销)
  • 当前 | 先前) 2017年5月1日 (一) 06:08Fruderica讨论 | 贡献. . (1,517字节) (+1,517). . (以“{{cpp/filesystem/path/title|generic_string|generic_wstring|generic_u8string|generic_u16string|generic_u32string}} {{cpp/filesystem/path/navbar}} {{dcl begin}} {{dcl ...”为内容创建页面)