• Class / Function / Type

      std::
    • Header file

      <>
    • Other / All

    最終更新日時(UTC):
    が更新

    履歴 編集

    function
    <filesystem>

    std::filesystem::path::wstring

    std::wstring 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.wstring();
      std::wcout << s << std::endl;
    }
    

    出力

    foo/bar
    

    バージョン

    言語

    • C++17

    処理系