首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

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 Allocator& a = Allocator() ) const;

(1)

(since C++17)

(2)

(since 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;

以泛型路径名格式返回内部路径名,转换为特定字符串类型。如有转换,则具体如下:

  • 如果path::value_typechar,如果有转换,则是系统依赖的。这是典型的POSIX系统%28(如linux%29)上的情况,其中本机编码为utf-8和string()不执行转换。
  • 否则,如果path::value_typewchar_t,如果有,则未指定转换。在Windows上就是这样,其中Wchar[医]T为16位,本机编码为UTF-16。
  • 否则,如果path::value_typechar16_t,本机编码为UTF-16,转换方法未指定。
  • 否则,如果path::value_typechar32_t,本机编码为UTF-32,转换方法未指定。

/字符用作目录分隔符。

1%29所有内存分配由a...

2%29结果编码u8string()一直都是UTF-8。

参数

a

-

allocator to construct the string with

类型要求

图表必须是编码字符类型%28 char,wchar[医]T,char16[医]T和char32[医]t%29

返回值

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

例外

%280%29

另见

stringwstringu8stringu16stringu32string

returns the path in native pathname format converted to a string (public member function)

代码语言:txt
复制
 © cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

扫码关注腾讯云开发者

领取腾讯云代金券