From Jason Turner

[filebuf.members]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpsf440qec/{from.md → to.md} +12 -10
tmp/tmpsf440qec/{from.md → to.md} RENAMED
@@ -11,19 +11,20 @@ non-null value) and there has been no intervening call to close.
11
  basic_filebuf* open(const char* s, ios_base::openmode mode);
12
  basic_filebuf* open(const filesystem::path::value_type* s,
13
  ios_base::openmode mode); // wide systems only; see [fstream.syn]
14
  ```
15
 
 
 
16
  *Effects:* If `is_open() != false`, returns a null pointer. Otherwise,
17
- initializes the `filebuf` as required. It then opens a file, if
18
- possible, whose name is the NTBS`s` (as if by calling
19
- `fopen(s, modstr)`). The NTBS`modstr` is determined from
20
- `mode & ~ios_base::ate` as indicated in
21
- Table  [[tab:iostreams.file.open.modes]]. If `mode` is not some
22
- combination of flags shown in the table then the open fails.
23
 
24
- **Table: File open modes** <a id="tab:iostreams.file.open.modes">[tab:iostreams.file.open.modes]</a>
25
 
26
  | `binary` | `in` | `out` | `trunc` | `app` | | `stdio` equivalent |
27
  | -------- | ---- | ----- | ------- | ----- | --- | ------------------ |
28
  | | | + | | | `"w"` |
29
  | | | + | | + | `"a"` |
@@ -42,13 +43,14 @@ combination of flags shown in the table then the open fails.
42
  | + | + | + | + | | `"w+b"` |
43
  | + | + | + | | + | `"a+b"` |
44
  | + | + | | | + | `"a+b"` |
45
 
46
 
47
- If the open operation succeeds and `(mode & ios_base::ate) != 0`,
48
  positions the file to the end (as if by calling
49
- `fseek(file, 0, SEEK_END)`).[^40]
 
50
 
51
  If the repositioning operation fails, calls `close()` and returns a null
52
  pointer to indicate failure.
53
 
54
  *Returns:* `this` if successful, a null pointer otherwise.
@@ -77,7 +79,7 @@ or throws an exception, the function closes the file (as if by calling
77
  these calls throws an exception, the exception is caught and rethrown
78
  after closing the file.
79
 
80
  *Returns:* `this` on success, a null pointer otherwise.
81
 
82
- *Postconditions:* `is_open() == false`.
83
 
 
11
  basic_filebuf* open(const char* s, ios_base::openmode mode);
12
  basic_filebuf* open(const filesystem::path::value_type* s,
13
  ios_base::openmode mode); // wide systems only; see [fstream.syn]
14
  ```
15
 
16
+ *Preconditions:* `s` points to a NTCTS [[defns.ntcts]].
17
+
18
  *Effects:* If `is_open() != false`, returns a null pointer. Otherwise,
19
+ initializes the `filebuf` as required. It then opens the file to which
20
+ `s` resolves, if possible, as if by a call to `fopen` with the second
21
+ argument determined from `mode & ~ios_base::ate` as indicated in
22
+ [[filebuf.open.modes]]. If `mode` is not some combination of flags shown
23
+ in the table then the open fails.
 
24
 
25
+ **Table: File open modes** <a id="filebuf.open.modes">[filebuf.open.modes]</a>
26
 
27
  | `binary` | `in` | `out` | `trunc` | `app` | | `stdio` equivalent |
28
  | -------- | ---- | ----- | ------- | ----- | --- | ------------------ |
29
  | | | + | | | `"w"` |
30
  | | | + | | + | `"a"` |
 
43
  | + | + | + | + | | `"w+b"` |
44
  | + | + | + | | + | `"a+b"` |
45
  | + | + | | | + | `"a+b"` |
46
 
47
 
48
+ If the open operation succeeds and `ios_base::ate` is set in `mode`,
49
  positions the file to the end (as if by calling
50
+ `fseek(file, 0, SEEK_END)`, where `file` is the pointer returned by
51
+ calling `fopen`). [^40]
52
 
53
  If the repositioning operation fails, calls `close()` and returns a null
54
  pointer to indicate failure.
55
 
56
  *Returns:* `this` if successful, a null pointer otherwise.
 
79
  these calls throws an exception, the exception is caught and rethrown
80
  after closing the file.
81
 
82
  *Returns:* `this` on success, a null pointer otherwise.
83
 
84
+ *Ensures:* `is_open() == false`.
85