Uploaded image for project: 'C++ Standard Library'
  1. C++ Standard Library
  2. STDCXX-930

[LWG #454] basic_filebuf::open should accept wchar_t names

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 4.2.1
    • Fix Version/s: 4.3.0
    • Component/s: 27. Input/Output
    • Labels:
      None
    • Severity:
      Usability

      Description

      LWG issue 454 proposes to change [filebuf.members] from:

          basic_filebuf<charT,traits>* open(const char* s, ios_base::openmode mode);
      

      Effects: If is_open() != false, returns a null pointer. Otherwise, initializes the filebuf as required. It then opens a file, if possible, whose name is the NTBS s ("as if" by calling std::fopen(s, modstr)).

      to:

          basic_filebuf<charT,traits>* open(const char* s, ios_base::openmode mode);
          basic_filebuf<charT,traits>* open(const wchar_t* ws, ios_base::openmode mode);
      
      

      Effects: If is_open() != false, returns a null pointer. Otherwise, initializes the filebuf as required. It then opens a file, if possible, whose name is the NTBS s ("as if" by calling std::fopen(s, modstr)). For the second signature, the NTBS s is determined from the WCBS ws in an implementation-defined manner.

      (NOTE: For a system that "naturally" represents a filename as a WCBS, the NTBS s in the first signature may instead be mapped to a WCBS; if so, it follows the same mapping rules as the first argument to open.)

        Attachments

          Activity

            People

            • Assignee:
              sebor Martin Sebor
              Reporter:
              sebor Martin Sebor
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:

                Time Tracking

                Estimated:
                Original Estimate - 6h Original Estimate - 6h
                6h
                Remaining:
                Time Spent - 6h Remaining Estimate - 2h
                2h
                Logged:
                Time Spent - 6h Remaining Estimate - 2h
                6h