Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(817)

Unified Diff: util/misc/uuid.h

Issue 820783004: Add UUID::InitializeFromString(). (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: For landing Created 5 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | util/misc/uuid.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/misc/uuid.h
diff --git a/util/misc/uuid.h b/util/misc/uuid.h
index c2529dfca74d9344790ee28c454d5aa73c68b6ca..27e2d9a5de1aca5eb35cbe27879a4b053a8dc1f5 100644
--- a/util/misc/uuid.h
+++ b/util/misc/uuid.h
@@ -19,6 +19,8 @@
#include <string>
+#include "base/strings/string_piece.h"
+
namespace crashpad {
//! \brief A universally unique identifier (%UUID).
@@ -49,6 +51,16 @@ struct UUID {
//! %UUID.
void InitializeFromBytes(const uint8_t* bytes);
+ //! \brief Initializes the %UUID from a RFC 4122 §3 formatted string.
+ //!
+ //! \param[in] string A string of the form
+ //! `"00112233-4455-6677-8899-aabbccddeeff"`.
+ //!
+ //! \return `true` if the string was formatted correctly and the object has
+ //! been initialized with the data. `false` if the string could not be
+ //! parsed, with the object state untouched.
+ bool InitializeFromString(const base::StringPiece& string);
+
//! \brief Formats the %UUID per RFC 4122 §3.
//!
//! \return A string of the form `"00112233-4455-6677-8899-aabbccddeeff"`.
« no previous file with comments | « no previous file | util/misc/uuid.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698