Skip to content

Latest commit

 

History

History
56 lines (40 loc) · 1.03 KB

File metadata and controls

56 lines (40 loc) · 1.03 KB

generic_wstring

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

概要

システムのワイド文字コードで、環境非依存パスフォーマットのパス文字列を取得する。

戻り値

*thisが保持するシステムの環境非依存パスフォーマットを持つパスを、システムのワイド文字コードで返す。

備考

  • WindowsではUTF-16となる

Windowsでの例

#include <iostream>
#include <filesystem>

namespace fs = std::filesystem;

int main()
{
  fs::path p = "foo\\bar";

  const std::wstring s = p.generic_wstring();
  std::wcout << s << std::endl;
}
  • p.generic_wstring()[color ff0000]

出力

foo/bar

バージョン

言語

  • C++17

処理系