tmp/tmpet5zcowu/{from.md → to.md}
RENAMED
|
@@ -32,19 +32,19 @@ namespace std {
|
|
| 32 |
virtual pos_type seekpos(pos_type sp, ios_base::openmode which
|
| 33 |
= ios_base::in | ios_base::out);
|
| 34 |
virtual streambuf* setbuf(char* s, streamsize n);
|
| 35 |
|
| 36 |
private:
|
| 37 |
-
typedef T1 strstate; // exposition
|
| 38 |
-
static const strstate allocated; // exposition
|
| 39 |
-
static const strstate constant; // exposition
|
| 40 |
-
static const strstate dynamic; // exposition
|
| 41 |
-
static const strstate frozen; // exposition
|
| 42 |
-
strstate strmode; // exposition
|
| 43 |
-
streamsize alsize; // exposition
|
| 44 |
-
void* (*palloc)(size_t); // exposition
|
| 45 |
-
void (*pfree)(void*); // exposition
|
| 46 |
};
|
| 47 |
}
|
| 48 |
```
|
| 49 |
|
| 50 |
The class `strstreambuf` associates the input sequence, and possibly the
|
|
@@ -68,12 +68,12 @@ are:
|
|
| 68 |
For the sake of exposition, the maintained data is presented here as:
|
| 69 |
|
| 70 |
- `strstate strmode`, the attributes of the array object associated with
|
| 71 |
the `strstreambuf` object;
|
| 72 |
- `int alsize`, the suggested minimum size for a dynamic array object;
|
| 73 |
-
- `void* (*palloc(size_t)`, points to the function to call to allocate
|
| 74 |
-
dynamic array object;
|
| 75 |
- `void (*pfree)(void*)`, points to the function to call to free a
|
| 76 |
dynamic array object.
|
| 77 |
|
| 78 |
Each object of class `strstreambuf` has a *seekable area*, delimited by
|
| 79 |
the pointers `seeklow` and `seekhigh`. If `gnext` is a null pointer, the
|
|
@@ -273,18 +273,19 @@ the positioning operation fails. Otherwise, the function determines
|
|
| 273 |
`newoff` as indicated in Table [[tab:future.newoff.values]].
|
| 274 |
|
| 275 |
**Table: `newoff` values** <a id="tab:future.newoff.values">[tab:future.newoff.values]</a>
|
| 276 |
|
| 277 |
| Condition | `newoff` Value |
|
| 278 |
-
| -----------------
|
| 279 |
| `way == ios::beg` | 0 |
|
| 280 |
| `way == ios::cur` | the next pointer minus the beginning pointer (`xnext - xbeg`). |
|
| 281 |
| `way == ios::end` | `seekhigh` minus the beginning pointer (`seekhigh - xbeg`). |
|
| 282 |
-
| If `(newoff + off) <`<br> `(seeklow - xbeg)`,<br> or `(seekhigh - xbeg) <`<br> `(newoff + off)` | the positioning operation fails |
|
| 283 |
|
| 284 |
|
| 285 |
-
|
|
|
|
|
|
|
| 286 |
pointer `xnext`.
|
| 287 |
|
| 288 |
*Returns:* `pos_type(newoff)`, constructed from the resultant offset
|
| 289 |
`newoff` (of type `off_type`), that stores the resultant stream
|
| 290 |
position, if possible. If the positioning operation fails, or if the
|
|
@@ -301,13 +302,16 @@ sequences, if possible, to correspond to the stream position stored in
|
|
| 301 |
`sp` (as described below).
|
| 302 |
|
| 303 |
- If `(which & ios::in) != 0`, positions the input sequence.
|
| 304 |
- If `(which & ios::out) != 0`, positions the output sequence.
|
| 305 |
- If the function positions neither sequence, the positioning operation
|
| 306 |
-
fails.
|
| 307 |
-
|
| 308 |
-
|
|
|
|
|
|
|
|
|
|
| 309 |
- If `newoff` is an invalid stream position, has a negative value, or
|
| 310 |
has a value greater than (`seekhigh` - `seeklow`), the positioning
|
| 311 |
operation fails
|
| 312 |
- Otherwise, the function adds `newoff` to the beginning pointer `xbeg`
|
| 313 |
and stores the result in the next pointer `xnext`.
|
|
|
|
| 32 |
virtual pos_type seekpos(pos_type sp, ios_base::openmode which
|
| 33 |
= ios_base::in | ios_base::out);
|
| 34 |
virtual streambuf* setbuf(char* s, streamsize n);
|
| 35 |
|
| 36 |
private:
|
| 37 |
+
typedef T1 strstate; // exposition only
|
| 38 |
+
static const strstate allocated; // exposition only
|
| 39 |
+
static const strstate constant; // exposition only
|
| 40 |
+
static const strstate dynamic; // exposition only
|
| 41 |
+
static const strstate frozen; // exposition only
|
| 42 |
+
strstate strmode; // exposition only
|
| 43 |
+
streamsize alsize; // exposition only
|
| 44 |
+
void* (*palloc)(size_t); // exposition only
|
| 45 |
+
void (*pfree)(void*); // exposition only
|
| 46 |
};
|
| 47 |
}
|
| 48 |
```
|
| 49 |
|
| 50 |
The class `strstreambuf` associates the input sequence, and possibly the
|
|
|
|
| 68 |
For the sake of exposition, the maintained data is presented here as:
|
| 69 |
|
| 70 |
- `strstate strmode`, the attributes of the array object associated with
|
| 71 |
the `strstreambuf` object;
|
| 72 |
- `int alsize`, the suggested minimum size for a dynamic array object;
|
| 73 |
+
- `void* (*palloc)(size_t)`, points to the function to call to allocate
|
| 74 |
+
a dynamic array object;
|
| 75 |
- `void (*pfree)(void*)`, points to the function to call to free a
|
| 76 |
dynamic array object.
|
| 77 |
|
| 78 |
Each object of class `strstreambuf` has a *seekable area*, delimited by
|
| 79 |
the pointers `seeklow` and `seekhigh`. If `gnext` is a null pointer, the
|
|
|
|
| 273 |
`newoff` as indicated in Table [[tab:future.newoff.values]].
|
| 274 |
|
| 275 |
**Table: `newoff` values** <a id="tab:future.newoff.values">[tab:future.newoff.values]</a>
|
| 276 |
|
| 277 |
| Condition | `newoff` Value |
|
| 278 |
+
| ----------------- | -------------------------------------------------------------- |
|
| 279 |
| `way == ios::beg` | 0 |
|
| 280 |
| `way == ios::cur` | the next pointer minus the beginning pointer (`xnext - xbeg`). |
|
| 281 |
| `way == ios::end` | `seekhigh` minus the beginning pointer (`seekhigh - xbeg`). |
|
|
|
|
| 282 |
|
| 283 |
|
| 284 |
+
If `(newoff + off) < (seeklow - xbeg)` or
|
| 285 |
+
`(seekhigh - xbeg) < (newoff + off)`, the positioning operation fails.
|
| 286 |
+
Otherwise, the function assigns `xbeg + newoff + off` to the next
|
| 287 |
pointer `xnext`.
|
| 288 |
|
| 289 |
*Returns:* `pos_type(newoff)`, constructed from the resultant offset
|
| 290 |
`newoff` (of type `off_type`), that stores the resultant stream
|
| 291 |
position, if possible. If the positioning operation fails, or if the
|
|
|
|
| 302 |
`sp` (as described below).
|
| 303 |
|
| 304 |
- If `(which & ios::in) != 0`, positions the input sequence.
|
| 305 |
- If `(which & ios::out) != 0`, positions the output sequence.
|
| 306 |
- If the function positions neither sequence, the positioning operation
|
| 307 |
+
fails.
|
| 308 |
+
|
| 309 |
+
For a sequence to be positioned, if its next pointer is a null pointer,
|
| 310 |
+
the positioning operation fails. Otherwise, the function determines
|
| 311 |
+
`newoff` from `sp.offset()`:
|
| 312 |
+
|
| 313 |
- If `newoff` is an invalid stream position, has a negative value, or
|
| 314 |
has a value greater than (`seekhigh` - `seeklow`), the positioning
|
| 315 |
operation fails
|
| 316 |
- Otherwise, the function adds `newoff` to the beginning pointer `xbeg`
|
| 317 |
and stores the result in the next pointer `xnext`.
|