diff --git a/Foundation/include/Poco/UUID.h b/Foundation/include/Poco/UUID.h index a08f2d0b6..db0f532e5 100644 --- a/Foundation/include/Poco/UUID.h +++ b/Foundation/include/Poco/UUID.h @@ -96,6 +96,12 @@ public: void parse(const std::string& uuid); /// 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; /// Returns a string representation of the UUID consisting /// 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 isNil() const; + bool isNull() const; /// Returns true iff the UUID is nil (in other words, /// consists of all zeros). - static const UUID& nil(); - /// Returns a nil UUID. + static const UUID& null(); + /// Returns a null/nil UUID. static const UUID& dns(); /// 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; }