mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-15 23:20:06 +02:00
trunk/branch integration: isNil() / isNull() / tryParse()
This commit is contained in:
@@ -96,6 +96,12 @@ public:
|
|||||||
void parse(const std::string& uuid);
|
void parse(const std::string& uuid);
|
||||||
/// Parses the UUID from its string representation.
|
/// Parses the UUID from its string representation.
|
||||||
|
|
||||||
|
bool tryParse(const std::string& uuid);
|
||||||
|
/// Tries to interpret the given string as an UUID.
|
||||||
|
/// If the UUID is syntactically valid, assigns the
|
||||||
|
/// members and returns true. Otherwise leaves the
|
||||||
|
/// object unchanged and returns false.
|
||||||
|
|
||||||
std::string toString() const;
|
std::string toString() const;
|
||||||
/// Returns a string representation of the UUID consisting
|
/// Returns a string representation of the UUID consisting
|
||||||
/// of groups of hexadecimal digits separated by hyphens.
|
/// of groups of hexadecimal digits separated by hyphens.
|
||||||
@@ -129,12 +135,12 @@ public:
|
|||||||
bool operator > (const UUID& uuid) const;
|
bool operator > (const UUID& uuid) const;
|
||||||
bool operator >= (const UUID& uuid) const;
|
bool operator >= (const UUID& uuid) const;
|
||||||
|
|
||||||
bool isNil() const;
|
bool isNull() const;
|
||||||
/// Returns true iff the UUID is nil (in other words,
|
/// Returns true iff the UUID is nil (in other words,
|
||||||
/// consists of all zeros).
|
/// consists of all zeros).
|
||||||
|
|
||||||
static const UUID& nil();
|
static const UUID& null();
|
||||||
/// Returns a nil UUID.
|
/// Returns a null/nil UUID.
|
||||||
|
|
||||||
static const UUID& dns();
|
static const UUID& dns();
|
||||||
/// Returns the namespace identifier for the DNS namespace.
|
/// Returns the namespace identifier for the DNS namespace.
|
||||||
@@ -215,9 +221,9 @@ inline UUID::Version UUID::version() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline bool UUID::isNil() const
|
inline bool UUID::isNull() const
|
||||||
{
|
{
|
||||||
return compare(nil()) == 0;
|
return compare(null()) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user