1
0
Fork 0

be tolerant of curly braces on input, but don't use them on output.

This commit is contained in:
Kevin Matz 2021-08-22 16:57:46 -04:00
parent 026a4a16de
commit cc40307adb
3 changed files with 4 additions and 4 deletions

View File

@ -31,7 +31,7 @@
TEST(UUID, ver4fromString)
{
// from online generator
auto str = std::string("{c2ffda84-0743-4d3f-8299-e2ba3a09e16c}");
auto str = std::string("c2ffda84-0743-4d3f-8299-e2ba3a09e16c");
auto uuid = UUID::uuid(str);
ASSERT_EQ(uuid.type(), UUID::RFC4122);

View File

@ -146,8 +146,8 @@ std::string uuid::string() const
str.reserve(str.length() + 6);
for (int idx : {8, 13, 18, 23})
str.insert(idx, "-");
str.insert(0, "{");
str.insert(str.length(), "}");
// str.insert(0, "{");
// str.insert(str.length(), "}");
return str;
};

View File

@ -127,7 +127,7 @@ public:
// output
std::string hex() const; // '12345678123456781234567812345678'
std::string string() const;// '{12345678-1234-5678-1234-567812345678}'
std::string string() const;// '12345678-1234-5678-1234-567812345678'
std::string urn() const; // 'urn:uuid:12345678-1234-5678-1234-567812345678'
// creators