Skip to content

Commit 924ea48

Browse files
AlisdairMtkoeppe
authored andcommitted
P2319R5 Prevent path presentation problems
1 parent 270aa15 commit 924ea48

File tree

3 files changed

+77
-7
lines changed

3 files changed

+77
-7
lines changed

source/future.tex

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -871,6 +871,45 @@
871871
\end{note}
872872
\end{itemdescr}
873873

874+
\rSec1[depr.fs.path.obs]{Deprecated filesystem path format observers}
875+
876+
\indexlibraryglobal{path}%
877+
\pnum
878+
The following members are declared in addition to those members
879+
specified in \ref{fs.path.member}:
880+
881+
\begin{codeblock}
882+
namespace std::filesystem {
883+
class path {
884+
public:
885+
std::string string() const;
886+
std::string generic_string() const;
887+
};
888+
}
889+
\end{codeblock}
890+
891+
\indexlibrarymember{string}{path}%
892+
\begin{itemdecl}
893+
std::string string() const;
894+
\end{itemdecl}
895+
896+
\begin{itemdescr}
897+
\pnum
898+
\returns
899+
\tcode{system_encoded_string()}.
900+
\end{itemdescr}
901+
902+
\indexlibrarymember{generic_string}{path}%
903+
\begin{itemdecl}
904+
std::string generic_string() const;
905+
\end{itemdecl}
906+
907+
\begin{itemdescr}
908+
\pnum
909+
\returns
910+
\tcode{generic_system_encoded_string()}.
911+
\end{itemdescr}
912+
874913
\rSec1[depr.atomics]{Deprecated atomic operations}
875914

876915
\rSec2[depr.atomics.general]{General}

source/iostreams.tex

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13708,7 +13708,8 @@
1370813708
class Allocator = allocator<EcharT>>
1370913709
basic_string<EcharT, traits, Allocator>
1371013710
string(const Allocator& a = Allocator()) const;
13711-
std::string string() const;
13711+
std::string display_string() const;
13712+
std::string system_encoded_string() const;
1371213713
std::wstring wstring() const;
1371313714
std::u8string u8string() const;
1371413715
std::u16string u16string() const;
@@ -13719,7 +13720,8 @@
1371913720
class Allocator = allocator<EcharT>>
1372013721
basic_string<EcharT, traits, Allocator>
1372113722
generic_string(const Allocator& a = Allocator()) const;
13722-
std::string generic_string() const;
13723+
std::string generic_display_string() const;
13724+
std::string generic_system_encoded_string() const;
1372313725
std::wstring generic_wstring() const;
1372413726
std::u8string generic_u8string() const;
1372513727
std::u16string generic_u16string() const;
@@ -14690,13 +14692,13 @@
1469014692
\ref{fs.path.cvt}.
1469114693
\end{itemdescr}
1469214694

14693-
\indexlibrarymember{string}{path}%
14695+
\indexlibrarymember{system_encoded_string}{path}%
1469414696
\indexlibrarymember{wstring}{path}%
1469514697
\indexlibrarymember{u8string}{path}%
1469614698
\indexlibrarymember{u16string}{path}%
1469714699
\indexlibrarymember{u32string}{path}%
1469814700
\begin{itemdecl}
14699-
std::string string() const;
14701+
std::string system_encoded_string() const;
1470014702
std::wstring wstring() const;
1470114703
std::u8string u8string() const;
1470214704
std::u16string u16string() const;
@@ -14714,6 +14716,20 @@
1471414716
by \ref{fs.path.cvt}.
1471514717
\end{itemdescr}
1471614718

14719+
\indexlibrarymember{display_string}{path}%
14720+
\begin{itemdecl}
14721+
std::string display_string() const;
14722+
\end{itemdecl}
14723+
14724+
\begin{itemdescr}
14725+
\pnum
14726+
\returns
14727+
\tcode{format("{}", *this)}.
14728+
\begin{note}
14729+
The returned string is suitable for use with formatting\iref{format.functions}
14730+
and print functions\iref{print.fun}.
14731+
\end{note}
14732+
\end{itemdescr}
1471714733

1471814734
\rSec4[fs.path.generic.obs]{Generic format observers}
1471914735

@@ -14753,13 +14769,13 @@
1475314769
\ref{fs.path.cvt}.
1475414770
\end{itemdescr}
1475514771

14756-
\indexlibrarymember{generic_string}{path}%
14772+
\indexlibrarymember{generic_system_encoded_string}{path}%
1475714773
\indexlibrarymember{generic_wstring}{path}%
1475814774
\indexlibrarymember{generic_u8string}{path}%
1475914775
\indexlibrarymember{generic_u16string}{path}%
1476014776
\indexlibrarymember{generic_u32string}{path}%
1476114777
\begin{itemdecl}
14762-
std::string generic_string() const;
14778+
std::string generic_system_encoded_string() const;
1476314779
std::wstring generic_wstring() const;
1476414780
std::u8string generic_u8string() const;
1476514781
std::u16string generic_u16string() const;
@@ -14776,6 +14792,21 @@
1477614792
Conversion, if any, is specified by~\ref{fs.path.cvt}.
1477714793
\end{itemdescr}
1477814794

14795+
\indexlibrarymember{generic_display_string}{path}%
14796+
\begin{itemdecl}
14797+
std::string generic_display_string() const;
14798+
\end{itemdecl}
14799+
14800+
\begin{itemdescr}
14801+
\pnum
14802+
\returns
14803+
\tcode{format("{:g}", *this)}.
14804+
\begin{note}
14805+
The returned string is suitable for use with formatting\iref{format.functions}
14806+
and print functions\iref{print.fun}.
14807+
\end{note}
14808+
\end{itemdescr}
14809+
1477914810
\rSec4[fs.path.compare]{Compare}
1478014811

1478114812
\indexlibrarymember{compare}{path}%

source/support.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@
676676
#define @\defnlibxname{cpp_lib_flat_set}@ 202207L // also in \libheader{flat_set}
677677
#define @\defnlibxname{cpp_lib_format}@ 202311L // also in \libheader{format}
678678
#define @\defnlibxname{cpp_lib_format_ranges}@ 202207L // also in \libheader{format}
679-
#define @\defnlibxname{cpp_lib_format_path}@ 202403L // also in \libheader{filesystem}
679+
#define @\defnlibxname{cpp_lib_format_path}@ 202506L // also in \libheader{filesystem}
680680
#define @\defnlibxname{cpp_lib_format_uchar}@ 202311L // also in \libheader{format}
681681
#define @\defnlibxname{cpp_lib_formatters}@ 202302L // also in \libheader{stacktrace}, \libheader{thread}
682682
#define @\defnlibxname{cpp_lib_forward_like}@ 202207L // freestanding, also in \libheader{utility}

0 commit comments

Comments
 (0)