This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of TS status.

2619. [filesys.ts] [PDTS] Consider using quoted manipulators

Section: 8.6.1 [filesys.ts::path.io] Status: TS Submitter: FI-8 Opened: 2014-01-20 Last modified: 2017-07-30

Priority: Not Prioritized

View all issues with TS status.

Discussion:

Addresses: filesys.ts

"[Note: Pathnames containing spaces require special handling by the user to avoid truncation when read by the extractor. — end note]" sounds like a quoted manipulator as specified in the C++14 draft in [quoted.manip] would be useful.

Consider using quoted manipulators for stream insertion and extraction.

[2014-02-10, Daniel suggests wording]

[2014-02-12 Applied LWG/SG-3 Issaquah wording tweak to use ISO doc number for reference to C++14.]

Proposed resolution:

  1. Change 8.6.1 [path.io] as indicated:

    template <class charT, class traits>
    basic_ostream<charT, traits>&
    operator<<(basic_ostream<charT, traits>& os, const path& p);
    

    Effects: os << quoted(p.string<charT, traits>()).

    [Note: Pathnames containing spaces require special handling by the user to avoid truncation when read by the extractor. — end note]

    [Note: The quoted function is described in ISO 14882:2014 §27.7.6. — end note]

    Returns: os

    template <class charT, class traits>
    basic_istream<charT, traits>&
    operator>>(basic_istream<charT, traits>& is, path& p);
    

    Effects:

    basic_string<charT, traits> tmp;
    is >> quoted(tmp);
    p = tmp;