tmp/tmplkeii3p_/{from.md → to.md}
RENAMED
|
@@ -38,19 +38,19 @@ namespace std {
|
|
| 38 |
virtual pos_type seekpos(pos_type sp, ios_base::openmode which
|
| 39 |
= ios_base::in | ios_base::out);
|
| 40 |
virtual streambuf* setbuf(char* s, streamsize n);
|
| 41 |
|
| 42 |
private:
|
| 43 |
-
typedef T1 strstate; // exposition
|
| 44 |
-
static const strstate allocated; // exposition
|
| 45 |
-
static const strstate constant; // exposition
|
| 46 |
-
static const strstate dynamic; // exposition
|
| 47 |
-
static const strstate frozen; // exposition
|
| 48 |
-
strstate strmode; // exposition
|
| 49 |
-
streamsize alsize; // exposition
|
| 50 |
-
void* (*palloc)(size_t); // exposition
|
| 51 |
-
void (*pfree)(void*); // exposition
|
| 52 |
};
|
| 53 |
}
|
| 54 |
```
|
| 55 |
|
| 56 |
The class `strstreambuf` associates the input sequence, and possibly the
|
|
@@ -74,12 +74,12 @@ are:
|
|
| 74 |
For the sake of exposition, the maintained data is presented here as:
|
| 75 |
|
| 76 |
- `strstate strmode`, the attributes of the array object associated with
|
| 77 |
the `strstreambuf` object;
|
| 78 |
- `int alsize`, the suggested minimum size for a dynamic array object;
|
| 79 |
-
- `void* (*palloc(size_t)`, points to the function to call to allocate
|
| 80 |
-
dynamic array object;
|
| 81 |
- `void (*pfree)(void*)`, points to the function to call to free a
|
| 82 |
dynamic array object.
|
| 83 |
|
| 84 |
Each object of class `strstreambuf` has a *seekable area*, delimited by
|
| 85 |
the pointers `seeklow` and `seekhigh`. If `gnext` is a null pointer, the
|
|
@@ -279,18 +279,19 @@ the positioning operation fails. Otherwise, the function determines
|
|
| 279 |
`newoff` as indicated in Table [[tab:future.newoff.values]].
|
| 280 |
|
| 281 |
**Table: `newoff` values** <a id="tab:future.newoff.values">[tab:future.newoff.values]</a>
|
| 282 |
|
| 283 |
| Condition | `newoff` Value |
|
| 284 |
-
| -----------------
|
| 285 |
| `way == ios::beg` | 0 |
|
| 286 |
| `way == ios::cur` | the next pointer minus the beginning pointer (`xnext - xbeg`). |
|
| 287 |
| `way == ios::end` | `seekhigh` minus the beginning pointer (`seekhigh - xbeg`). |
|
| 288 |
-
| If `(newoff + off) <`<br> `(seeklow - xbeg)`,<br> or `(seekhigh - xbeg) <`<br> `(newoff + off)` | the positioning operation fails |
|
| 289 |
|
| 290 |
|
| 291 |
-
|
|
|
|
|
|
|
| 292 |
pointer `xnext`.
|
| 293 |
|
| 294 |
*Returns:* `pos_type(newoff)`, constructed from the resultant offset
|
| 295 |
`newoff` (of type `off_type`), that stores the resultant stream
|
| 296 |
position, if possible. If the positioning operation fails, or if the
|
|
@@ -307,13 +308,16 @@ sequences, if possible, to correspond to the stream position stored in
|
|
| 307 |
`sp` (as described below).
|
| 308 |
|
| 309 |
- If `(which & ios::in) != 0`, positions the input sequence.
|
| 310 |
- If `(which & ios::out) != 0`, positions the output sequence.
|
| 311 |
- If the function positions neither sequence, the positioning operation
|
| 312 |
-
fails.
|
| 313 |
-
|
| 314 |
-
|
|
|
|
|
|
|
|
|
|
| 315 |
- If `newoff` is an invalid stream position, has a negative value, or
|
| 316 |
has a value greater than (`seekhigh` - `seeklow`), the positioning
|
| 317 |
operation fails
|
| 318 |
- Otherwise, the function adds `newoff` to the beginning pointer `xbeg`
|
| 319 |
and stores the result in the next pointer `xnext`.
|
|
@@ -344,11 +348,11 @@ namespace std {
|
|
| 344 |
virtual ~istrstream();
|
| 345 |
|
| 346 |
strstreambuf* rdbuf() const;
|
| 347 |
char* str();
|
| 348 |
private:
|
| 349 |
-
strstreambuf sb; // exposition
|
| 350 |
};
|
| 351 |
}
|
| 352 |
```
|
| 353 |
|
| 354 |
The class `istrstream` supports the reading of objects of class
|
|
@@ -405,11 +409,11 @@ namespace std {
|
|
| 405 |
strstreambuf* rdbuf() const;
|
| 406 |
void freeze(bool freezefl = true);
|
| 407 |
char* str();
|
| 408 |
int pcount() const;
|
| 409 |
private:
|
| 410 |
-
strstreambuf sb; // exposition
|
| 411 |
};
|
| 412 |
}
|
| 413 |
```
|
| 414 |
|
| 415 |
The class `ostrstream` supports the writing of objects of class
|
|
@@ -494,19 +498,19 @@ namespace std {
|
|
| 494 |
void freeze(bool freezefl = true);
|
| 495 |
int pcount() const;
|
| 496 |
char* str();
|
| 497 |
|
| 498 |
private:
|
| 499 |
-
strstreambuf sb; // exposition
|
| 500 |
};
|
| 501 |
}
|
| 502 |
```
|
| 503 |
|
| 504 |
-
The class `strstream` supports reading and writing from objects of
|
| 505 |
-
|
| 506 |
-
|
| 507 |
-
|
| 508 |
|
| 509 |
- `sb`, the `strstreambuf` object.
|
| 510 |
|
| 511 |
#### `strstream` constructors <a id="depr.strstream.cons">[[depr.strstream.cons]]</a>
|
| 512 |
|
|
@@ -534,11 +538,11 @@ two constructors:
|
|
| 534 |
`strstreambuf(s,n,s + std::strlen(s))`.
|
| 535 |
|
| 536 |
#### `strstream` destructor <a id="depr.strstream.dest">[[depr.strstream.dest]]</a>
|
| 537 |
|
| 538 |
``` cpp
|
| 539 |
-
virtual ~strstream()
|
| 540 |
```
|
| 541 |
|
| 542 |
*Effects:* Destroys an object of class `strstream`.
|
| 543 |
|
| 544 |
``` cpp
|
|
|
|
| 38 |
virtual pos_type seekpos(pos_type sp, ios_base::openmode which
|
| 39 |
= ios_base::in | ios_base::out);
|
| 40 |
virtual streambuf* setbuf(char* s, streamsize n);
|
| 41 |
|
| 42 |
private:
|
| 43 |
+
typedef T1 strstate; // exposition only
|
| 44 |
+
static const strstate allocated; // exposition only
|
| 45 |
+
static const strstate constant; // exposition only
|
| 46 |
+
static const strstate dynamic; // exposition only
|
| 47 |
+
static const strstate frozen; // exposition only
|
| 48 |
+
strstate strmode; // exposition only
|
| 49 |
+
streamsize alsize; // exposition only
|
| 50 |
+
void* (*palloc)(size_t); // exposition only
|
| 51 |
+
void (*pfree)(void*); // exposition only
|
| 52 |
};
|
| 53 |
}
|
| 54 |
```
|
| 55 |
|
| 56 |
The class `strstreambuf` associates the input sequence, and possibly the
|
|
|
|
| 74 |
For the sake of exposition, the maintained data is presented here as:
|
| 75 |
|
| 76 |
- `strstate strmode`, the attributes of the array object associated with
|
| 77 |
the `strstreambuf` object;
|
| 78 |
- `int alsize`, the suggested minimum size for a dynamic array object;
|
| 79 |
+
- `void* (*palloc)(size_t)`, points to the function to call to allocate
|
| 80 |
+
a dynamic array object;
|
| 81 |
- `void (*pfree)(void*)`, points to the function to call to free a
|
| 82 |
dynamic array object.
|
| 83 |
|
| 84 |
Each object of class `strstreambuf` has a *seekable area*, delimited by
|
| 85 |
the pointers `seeklow` and `seekhigh`. If `gnext` is a null pointer, the
|
|
|
|
| 279 |
`newoff` as indicated in Table [[tab:future.newoff.values]].
|
| 280 |
|
| 281 |
**Table: `newoff` values** <a id="tab:future.newoff.values">[tab:future.newoff.values]</a>
|
| 282 |
|
| 283 |
| Condition | `newoff` Value |
|
| 284 |
+
| ----------------- | -------------------------------------------------------------- |
|
| 285 |
| `way == ios::beg` | 0 |
|
| 286 |
| `way == ios::cur` | the next pointer minus the beginning pointer (`xnext - xbeg`). |
|
| 287 |
| `way == ios::end` | `seekhigh` minus the beginning pointer (`seekhigh - xbeg`). |
|
|
|
|
| 288 |
|
| 289 |
|
| 290 |
+
If `(newoff + off) < (seeklow - xbeg)` or
|
| 291 |
+
`(seekhigh - xbeg) < (newoff + off)`, the positioning operation fails.
|
| 292 |
+
Otherwise, the function assigns `xbeg + newoff + off` to the next
|
| 293 |
pointer `xnext`.
|
| 294 |
|
| 295 |
*Returns:* `pos_type(newoff)`, constructed from the resultant offset
|
| 296 |
`newoff` (of type `off_type`), that stores the resultant stream
|
| 297 |
position, if possible. If the positioning operation fails, or if the
|
|
|
|
| 308 |
`sp` (as described below).
|
| 309 |
|
| 310 |
- If `(which & ios::in) != 0`, positions the input sequence.
|
| 311 |
- If `(which & ios::out) != 0`, positions the output sequence.
|
| 312 |
- If the function positions neither sequence, the positioning operation
|
| 313 |
+
fails.
|
| 314 |
+
|
| 315 |
+
For a sequence to be positioned, if its next pointer is a null pointer,
|
| 316 |
+
the positioning operation fails. Otherwise, the function determines
|
| 317 |
+
`newoff` from `sp.offset()`:
|
| 318 |
+
|
| 319 |
- If `newoff` is an invalid stream position, has a negative value, or
|
| 320 |
has a value greater than (`seekhigh` - `seeklow`), the positioning
|
| 321 |
operation fails
|
| 322 |
- Otherwise, the function adds `newoff` to the beginning pointer `xbeg`
|
| 323 |
and stores the result in the next pointer `xnext`.
|
|
|
|
| 348 |
virtual ~istrstream();
|
| 349 |
|
| 350 |
strstreambuf* rdbuf() const;
|
| 351 |
char* str();
|
| 352 |
private:
|
| 353 |
+
strstreambuf sb; // exposition only
|
| 354 |
};
|
| 355 |
}
|
| 356 |
```
|
| 357 |
|
| 358 |
The class `istrstream` supports the reading of objects of class
|
|
|
|
| 409 |
strstreambuf* rdbuf() const;
|
| 410 |
void freeze(bool freezefl = true);
|
| 411 |
char* str();
|
| 412 |
int pcount() const;
|
| 413 |
private:
|
| 414 |
+
strstreambuf sb; // exposition only
|
| 415 |
};
|
| 416 |
}
|
| 417 |
```
|
| 418 |
|
| 419 |
The class `ostrstream` supports the writing of objects of class
|
|
|
|
| 498 |
void freeze(bool freezefl = true);
|
| 499 |
int pcount() const;
|
| 500 |
char* str();
|
| 501 |
|
| 502 |
private:
|
| 503 |
+
strstreambuf sb; // exposition only
|
| 504 |
};
|
| 505 |
}
|
| 506 |
```
|
| 507 |
|
| 508 |
+
The class `strstream` supports reading and writing from objects of class
|
| 509 |
+
`strstreambuf`. It supplies a `strstreambuf` object to control the
|
| 510 |
+
associated array object. For the sake of exposition, the maintained data
|
| 511 |
+
is presented here as:
|
| 512 |
|
| 513 |
- `sb`, the `strstreambuf` object.
|
| 514 |
|
| 515 |
#### `strstream` constructors <a id="depr.strstream.cons">[[depr.strstream.cons]]</a>
|
| 516 |
|
|
|
|
| 538 |
`strstreambuf(s,n,s + std::strlen(s))`.
|
| 539 |
|
| 540 |
#### `strstream` destructor <a id="depr.strstream.dest">[[depr.strstream.dest]]</a>
|
| 541 |
|
| 542 |
``` cpp
|
| 543 |
+
virtual ~strstream();
|
| 544 |
```
|
| 545 |
|
| 546 |
*Effects:* Destroys an object of class `strstream`.
|
| 547 |
|
| 548 |
``` cpp
|