This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Equivalence table between C++ and C file open modes


Paolo Carlini wrote:

I'm committing the below to mainline.

Actually, this version, which seems more clear and puts at the end the lines new wrt C++03 (at some point we may add more...)


Paolo.

///////////
Index: fstream
===================================================================
--- fstream	(revision 125496)
+++ fstream	(working copy)
@@ -257,9 +257,30 @@
        *  Otherwise it tries to open the file named @a s using the flags
        *  given in @a mode.
        *
-       *  [Table 92 gives the relation between openmode combinations and the
-       *  equivalent fopen() flags, but the table has not been copied yet.]
-      */
+       *  Table 92, adapted here, gives the relation between openmode
+       *  combinations and the equivalent fopen() flags.
+       *  (NB: lines in|out|app and binary|in|out|app per DR 596)
+       *  +---------------------------------------------------------+
+       *  | ios_base Flag combination            stdio equivalent   |
+       *  |binary  in  out  trunc  app                              |
+       *  +---------------------------------------------------------+
+       *  |             +                        "w"                |
+       *  |             +           +            "a"                |
+       *  |             +     +                  "w"                |
+       *  |         +                            "r"                |
+       *  |         +   +                        "r+"               |
+       *  |         +   +     +                  "w+"               |
+       *  |         +   +           +            "a+"               |
+       *  +---------------------------------------------------------+
+       *  |   +         +                        "wb"               |
+       *  |   +         +           +            "ab"               |
+       *  |   +         +     +                  "wb"               |
+       *  |   +     +                            "rb"               |
+       *  |   +     +   +                        "r+b"              |
+       *  |   +     +   +     +                  "w+b"              |
+       *  |   +     +   +           +            "a+b"              |
+       *  +---------------------------------------------------------+
+       */
       __filebuf_type*
       open(const char* __s, ios_base::openmode __mode);
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]