Skip to content

Files

69 lines (51 loc) · 1.12 KB

u16string.md

File metadata and controls

69 lines (51 loc) · 1.12 KB

u16string

  • filesystem[meta header]
  • std::filesystem[meta namespace]
  • path[meta class]
  • function[meta id-type]
  • cpp17[meta cpp]
std::u16string u16string() const;

概要

UTF-16エンコードで、パス文字列を取得する。

戻り値

*thisが保持するシステムのネイティブフォーマットを持つパスを、UTF-16エンコードで返す。

POSIXベースシステムでの例

#include <iostream>
#include <filesystem>

namespace fs = std::filesystem;

int main()
{
  fs::path p = "/usr/bin/clang";
  const std::u16string s = p.u16string();
}
  • p.u16string()[color ff0000]

出力

Windowsでの例

#include <iostream>
#include <filesystem>

namespace fs = std::filesystem;

int main()
{
  fs::path p = "foo/bar";
  const std::u16string s = p.u16string();
}
  • p.u16string()[color ff0000]

出力

バージョン

言語

  • C++17

処理系