2
0
mirror of https://github.com/boostorg/uuid.git synced 2026-01-19 04:42:16 +00:00

Update documentation

This commit is contained in:
Peter Dimov
2026-01-15 15:38:40 +02:00
parent c4678bf9a6
commit f4bcc0fd2a
5 changed files with 52 additions and 3 deletions

View File

@@ -12,6 +12,7 @@
* Added SIMD implementation of `to_chars`, which can offer up to 5.5x performance improvement in UUID formatting. (Andrey Semashev)
* Added SIMD implementation of `from_chars`, which can offer up to 13x performance improvement in UUID parsing. (Andrey Semashev)
* Added `uuid_from_string` to `boost/uuid/uuid_io.hpp`.
* Added a dedicated `invalid_uuid` exception class, derived from `std::runtime_error` for backward compatibility.
== Changes in Boost 1.90.0

View File

@@ -0,0 +1,47 @@
[#invalid_uuid]
== <boost/uuid/invalid_uuid.hpp>
:idprefix: invalid_uuid_
=== Synopsis
[source,c++]
----
namespace boost {
namespace uuids {
class invalid_uuid: public std::runtime_error
{
public:
invalid_uuid( std::ptrdiff_t pos, from_chars_error err );
std::ptrdiff_t position() const noexcept;
from_chars_error error() const noexcept;
};
}} // namespace boost::uuids
----
=== invalid_uuid
Functions that parse a string UUID representation throw an exception of type `invalid_uuid` to indicate failure.
```
invalid_uuid( std::ptrdiff_t pos, from_chars_error err );
```
Effects: :: Constructs an `invalid_uuid` object, initializing its internal members to `pos` and `err` and the `runtime_error` base class with an appropriate error message.
Postconditions: :: `this\->position() == pos && this\->error() == err`.
```
std::ptrdiff_t position() const noexcept;
```
Returns: :: The zero-based position in the input string at which parsing failed.
```
from_chars_error error() const noexcept;
```
Returns: :: The error code describing the reason parsing failed.

View File

@@ -4,6 +4,7 @@
include::uuid_all.adoc[]
include::uuid.adoc[]
include::uuid_io.adoc[]
include::invalid_uuid.adoc[]
include::generators.adoc[]
include::nil_generator.adoc[]
include::string_generator.adoc[]

View File

@@ -52,7 +52,7 @@ hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
{hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh}
```
Invalid input will generate a `std::runtime_error` exception.
Invalid input will throw an `invalid_uuid` exception.
```
template<class Str>

View File

@@ -285,7 +285,7 @@ Requires: :: `Ch` must be a character type (one of `char`, `wchar_t`, `char8_t`,
Effects: ::
Parses a `uuid` string representation from the characters in the range `[str, str + std::char_traits<Ch>::length(str))` and stores the result in `u`.
On error, throws `std::runtime_error`.
On error, throws `invalid_uuid`.
NOTE: Unlike `from_chars`, this function does not allow extra input; if after a complete UUID is parsed, unconsumed characters remain, an exception is thrown.
@@ -300,6 +300,6 @@ Requires: ::
Effects: ::
Parses a `uuid` string representation from the characters in the range `[str.data(), str.data() + str.size())` and stores the result in `u`.
On error, throws `std::runtime_error`.
On error, throws `invalid_uuid`.
NOTE: Unlike `from_chars`, this function does not allow extra input; if after a complete UUID is parsed, unconsumed characters remain, an exception is thrown.