tmp/tmpkm3cqgdu/{from.md → to.md}
RENAMED
|
@@ -4,11 +4,11 @@
|
|
| 4 |
|
| 5 |
``` cpp
|
| 6 |
path() noexcept;
|
| 7 |
```
|
| 8 |
|
| 9 |
-
*Ensures:* `empty()
|
| 10 |
|
| 11 |
``` cpp
|
| 12 |
path(const path& p);
|
| 13 |
path(path&& p) noexcept;
|
| 14 |
```
|
|
@@ -252,11 +252,11 @@ template<class InputIterator>
|
|
| 252 |
|
| 253 |
``` cpp
|
| 254 |
void clear() noexcept;
|
| 255 |
```
|
| 256 |
|
| 257 |
-
*Ensures:* `empty()
|
| 258 |
|
| 259 |
``` cpp
|
| 260 |
path& make_preferred();
|
| 261 |
```
|
| 262 |
|
|
@@ -381,24 +381,22 @@ operator string_type() const;
|
|
| 381 |
```
|
| 382 |
|
| 383 |
*Returns:* `native()`.
|
| 384 |
|
| 385 |
``` cpp
|
| 386 |
-
template<class EcharT, class traits = char_traits<EcharT>,
|
| 387 |
-
|
| 388 |
-
basic_string<EcharT, traits, Allocator>
|
| 389 |
-
string(const Allocator& a = Allocator()) const;
|
| 390 |
```
|
| 391 |
|
| 392 |
*Returns:* `native()`.
|
| 393 |
|
| 394 |
*Remarks:* All memory allocation, including for the return value, shall
|
| 395 |
be performed by `a`. Conversion, if any, is specified by
|
| 396 |
[[fs.path.cvt]].
|
| 397 |
|
| 398 |
``` cpp
|
| 399 |
-
std::string
|
| 400 |
std::wstring wstring() const;
|
| 401 |
std::u8string u8string() const;
|
| 402 |
std::u16string u16string() const;
|
| 403 |
std::u32string u32string() const;
|
| 404 |
```
|
|
@@ -406,10 +404,20 @@ std::u32string u32string() const;
|
|
| 406 |
*Returns:* `native()`.
|
| 407 |
|
| 408 |
*Remarks:* Conversion, if any, is performed as specified by
|
| 409 |
[[fs.path.cvt]].
|
| 410 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 411 |
##### Generic format observers <a id="fs.path.generic.obs">[[fs.path.generic.obs]]</a>
|
| 412 |
|
| 413 |
Generic format observer functions return strings formatted according to
|
| 414 |
the generic pathname format [[fs.path.generic]]. A single slash (`'/'`)
|
| 415 |
character is used as the *directory-separator*.
|
|
@@ -425,34 +433,42 @@ path("foo\\bar").generic_string()
|
|
| 425 |
returns `"foo/bar"`.
|
| 426 |
|
| 427 |
— *end example*]
|
| 428 |
|
| 429 |
``` cpp
|
| 430 |
-
template<class EcharT, class traits = char_traits<EcharT>,
|
| 431 |
-
|
| 432 |
-
basic_string<EcharT, traits, Allocator>
|
| 433 |
-
generic_string(const Allocator& a = Allocator()) const;
|
| 434 |
```
|
| 435 |
|
| 436 |
*Returns:* The pathname in the generic format.
|
| 437 |
|
| 438 |
*Remarks:* All memory allocation, including for the return value, shall
|
| 439 |
be performed by `a`. Conversion, if any, is specified by
|
| 440 |
[[fs.path.cvt]].
|
| 441 |
|
| 442 |
``` cpp
|
| 443 |
-
std::string
|
| 444 |
std::wstring generic_wstring() const;
|
| 445 |
std::u8string generic_u8string() const;
|
| 446 |
std::u16string generic_u16string() const;
|
| 447 |
std::u32string generic_u32string() const;
|
| 448 |
```
|
| 449 |
|
| 450 |
*Returns:* The pathname in the generic format.
|
| 451 |
|
| 452 |
*Remarks:* Conversion, if any, is specified by [[fs.path.cvt]].
|
| 453 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 454 |
##### Compare <a id="fs.path.compare">[[fs.path.compare]]</a>
|
| 455 |
|
| 456 |
``` cpp
|
| 457 |
int compare(const path& p) const noexcept;
|
| 458 |
```
|
|
@@ -583,22 +599,22 @@ path(".bar").extension(); // yields "" and stem() is ".bar"
|
|
| 583 |
path("..bar").extension(); // yields ".bar" and stem() is "."
|
| 584 |
```
|
| 585 |
|
| 586 |
— *end example*]
|
| 587 |
|
| 588 |
-
[*Note
|
| 589 |
possible to distinguish between no extension and an empty
|
| 590 |
extension. — *end note*]
|
| 591 |
|
| 592 |
-
[*Note
|
| 593 |
possible that `p.stem() + p.extension() == p.filename()` is `false`,
|
| 594 |
even though the generic format pathnames are the same. — *end note*]
|
| 595 |
|
| 596 |
##### Query <a id="fs.path.query">[[fs.path.query]]</a>
|
| 597 |
|
| 598 |
``` cpp
|
| 599 |
-
|
| 600 |
```
|
| 601 |
|
| 602 |
*Returns:* `true` if the pathname in the generic format is empty,
|
| 603 |
otherwise `false`.
|
| 604 |
|
|
@@ -702,11 +718,11 @@ path lexically_relative(const path& base) const;
|
|
| 702 |
- any *filename* in `relative_path()` or `base.relative_path()` can be
|
| 703 |
interpreted as a *root-name*,
|
| 704 |
|
| 705 |
returns `path()`.
|
| 706 |
|
| 707 |
-
[*Note
|
| 708 |
*relative-path* is acceptable as a *root-name*. — *end note*]
|
| 709 |
|
| 710 |
Determines the first mismatched element of `*this` and `base` as if by:
|
| 711 |
|
| 712 |
``` cpp
|
|
@@ -745,26 +761,26 @@ The above assertions will succeed. On Windows, the returned path’s
|
|
| 745 |
*directory-separator* characters will be backslashes rather than
|
| 746 |
slashes, but that does not affect `path` equality.
|
| 747 |
|
| 748 |
— *end example*]
|
| 749 |
|
| 750 |
-
[*Note
|
| 751 |
operational function `relative()`. — *end note*]
|
| 752 |
|
| 753 |
-
[*Note
|
| 754 |
consistent matching of elements, apply `lexically_normal()` to `*this`,
|
| 755 |
`base`, or both. — *end note*]
|
| 756 |
|
| 757 |
``` cpp
|
| 758 |
path lexically_proximate(const path& base) const;
|
| 759 |
```
|
| 760 |
|
| 761 |
*Returns:* If the value of `lexically_relative(base)` is not an empty
|
| 762 |
path, return it. Otherwise return `*this`.
|
| 763 |
|
| 764 |
-
[*Note
|
| 765 |
operational function `proximate()`. — *end note*]
|
| 766 |
|
| 767 |
-
[*Note
|
| 768 |
consistent matching of elements, apply `lexically_normal()` to `*this`,
|
| 769 |
`base`, or both. — *end note*]
|
| 770 |
|
|
|
|
| 4 |
|
| 5 |
``` cpp
|
| 6 |
path() noexcept;
|
| 7 |
```
|
| 8 |
|
| 9 |
+
*Ensures:* `empty()` is `true`.
|
| 10 |
|
| 11 |
``` cpp
|
| 12 |
path(const path& p);
|
| 13 |
path(path&& p) noexcept;
|
| 14 |
```
|
|
|
|
| 252 |
|
| 253 |
``` cpp
|
| 254 |
void clear() noexcept;
|
| 255 |
```
|
| 256 |
|
| 257 |
+
*Ensures:* `empty()` is `true`.
|
| 258 |
|
| 259 |
``` cpp
|
| 260 |
path& make_preferred();
|
| 261 |
```
|
| 262 |
|
|
|
|
| 381 |
```
|
| 382 |
|
| 383 |
*Returns:* `native()`.
|
| 384 |
|
| 385 |
``` cpp
|
| 386 |
+
template<class EcharT, class traits = char_traits<EcharT>, class Allocator = allocator<EcharT>>
|
| 387 |
+
basic_string<EcharT, traits, Allocator> string(const Allocator& a = Allocator()) const;
|
|
|
|
|
|
|
| 388 |
```
|
| 389 |
|
| 390 |
*Returns:* `native()`.
|
| 391 |
|
| 392 |
*Remarks:* All memory allocation, including for the return value, shall
|
| 393 |
be performed by `a`. Conversion, if any, is specified by
|
| 394 |
[[fs.path.cvt]].
|
| 395 |
|
| 396 |
``` cpp
|
| 397 |
+
std::string system_encoded_string() const;
|
| 398 |
std::wstring wstring() const;
|
| 399 |
std::u8string u8string() const;
|
| 400 |
std::u16string u16string() const;
|
| 401 |
std::u32string u32string() const;
|
| 402 |
```
|
|
|
|
| 404 |
*Returns:* `native()`.
|
| 405 |
|
| 406 |
*Remarks:* Conversion, if any, is performed as specified by
|
| 407 |
[[fs.path.cvt]].
|
| 408 |
|
| 409 |
+
``` cpp
|
| 410 |
+
std::string display_string() const;
|
| 411 |
+
```
|
| 412 |
+
|
| 413 |
+
*Returns:* `std::format("{}", *this)`.
|
| 414 |
+
|
| 415 |
+
[*Note 3*: The returned string is suitable for use with
|
| 416 |
+
formatting [[format.functions]] and print
|
| 417 |
+
functions [[print.fun]]. — *end note*]
|
| 418 |
+
|
| 419 |
##### Generic format observers <a id="fs.path.generic.obs">[[fs.path.generic.obs]]</a>
|
| 420 |
|
| 421 |
Generic format observer functions return strings formatted according to
|
| 422 |
the generic pathname format [[fs.path.generic]]. A single slash (`'/'`)
|
| 423 |
character is used as the *directory-separator*.
|
|
|
|
| 433 |
returns `"foo/bar"`.
|
| 434 |
|
| 435 |
— *end example*]
|
| 436 |
|
| 437 |
``` cpp
|
| 438 |
+
template<class EcharT, class traits = char_traits<EcharT>, class Allocator = allocator<EcharT>>
|
| 439 |
+
basic_string<EcharT, traits, Allocator> generic_string(const Allocator& a = Allocator()) const;
|
|
|
|
|
|
|
| 440 |
```
|
| 441 |
|
| 442 |
*Returns:* The pathname in the generic format.
|
| 443 |
|
| 444 |
*Remarks:* All memory allocation, including for the return value, shall
|
| 445 |
be performed by `a`. Conversion, if any, is specified by
|
| 446 |
[[fs.path.cvt]].
|
| 447 |
|
| 448 |
``` cpp
|
| 449 |
+
std::string generic_system_encoded_string() const;
|
| 450 |
std::wstring generic_wstring() const;
|
| 451 |
std::u8string generic_u8string() const;
|
| 452 |
std::u16string generic_u16string() const;
|
| 453 |
std::u32string generic_u32string() const;
|
| 454 |
```
|
| 455 |
|
| 456 |
*Returns:* The pathname in the generic format.
|
| 457 |
|
| 458 |
*Remarks:* Conversion, if any, is specified by [[fs.path.cvt]].
|
| 459 |
|
| 460 |
+
``` cpp
|
| 461 |
+
std::string generic_display_string() const;
|
| 462 |
+
```
|
| 463 |
+
|
| 464 |
+
*Returns:* `std::format("{:g}", *this)`.
|
| 465 |
+
|
| 466 |
+
[*Note 4*: The returned string is suitable for use with
|
| 467 |
+
formatting [[format.functions]] and print
|
| 468 |
+
functions [[print.fun]]. — *end note*]
|
| 469 |
+
|
| 470 |
##### Compare <a id="fs.path.compare">[[fs.path.compare]]</a>
|
| 471 |
|
| 472 |
``` cpp
|
| 473 |
int compare(const path& p) const noexcept;
|
| 474 |
```
|
|
|
|
| 599 |
path("..bar").extension(); // yields ".bar" and stem() is "."
|
| 600 |
```
|
| 601 |
|
| 602 |
— *end example*]
|
| 603 |
|
| 604 |
+
[*Note 5*: The period is included in the return value so that it is
|
| 605 |
possible to distinguish between no extension and an empty
|
| 606 |
extension. — *end note*]
|
| 607 |
|
| 608 |
+
[*Note 6*: On non-POSIX operating systems, for a path `p`, it is
|
| 609 |
possible that `p.stem() + p.extension() == p.filename()` is `false`,
|
| 610 |
even though the generic format pathnames are the same. — *end note*]
|
| 611 |
|
| 612 |
##### Query <a id="fs.path.query">[[fs.path.query]]</a>
|
| 613 |
|
| 614 |
``` cpp
|
| 615 |
+
bool empty() const noexcept;
|
| 616 |
```
|
| 617 |
|
| 618 |
*Returns:* `true` if the pathname in the generic format is empty,
|
| 619 |
otherwise `false`.
|
| 620 |
|
|
|
|
| 718 |
- any *filename* in `relative_path()` or `base.relative_path()` can be
|
| 719 |
interpreted as a *root-name*,
|
| 720 |
|
| 721 |
returns `path()`.
|
| 722 |
|
| 723 |
+
[*Note 7*: On a POSIX implementation, no *filename* in a
|
| 724 |
*relative-path* is acceptable as a *root-name*. — *end note*]
|
| 725 |
|
| 726 |
Determines the first mismatched element of `*this` and `base` as if by:
|
| 727 |
|
| 728 |
``` cpp
|
|
|
|
| 761 |
*directory-separator* characters will be backslashes rather than
|
| 762 |
slashes, but that does not affect `path` equality.
|
| 763 |
|
| 764 |
— *end example*]
|
| 765 |
|
| 766 |
+
[*Note 8*: If symlink following semantics are desired, use the
|
| 767 |
operational function `relative()`. — *end note*]
|
| 768 |
|
| 769 |
+
[*Note 9*: If normalization [[fs.path.generic]] is needed to ensure
|
| 770 |
consistent matching of elements, apply `lexically_normal()` to `*this`,
|
| 771 |
`base`, or both. — *end note*]
|
| 772 |
|
| 773 |
``` cpp
|
| 774 |
path lexically_proximate(const path& base) const;
|
| 775 |
```
|
| 776 |
|
| 777 |
*Returns:* If the value of `lexically_relative(base)` is not an empty
|
| 778 |
path, return it. Otherwise return `*this`.
|
| 779 |
|
| 780 |
+
[*Note 10*: If symlink following semantics are desired, use the
|
| 781 |
operational function `proximate()`. — *end note*]
|
| 782 |
|
| 783 |
+
[*Note 11*: If normalization [[fs.path.generic]] is needed to ensure
|
| 784 |
consistent matching of elements, apply `lexically_normal()` to `*this`,
|
| 785 |
`base`, or both. — *end note*]
|
| 786 |
|