23 ID::string_assign (string str)
25 /* first check for old-style all-numeric ID's */
27 if (strcspn (str.c_str(), "0123456789") == 0) {
28 /* all chars are numeric. just render the existing ID into the space in
29 which we would otherwise store a UUID.
32 memset (id, ' ', sizeof (id));
33 snprintf ((char*) id, sizeof (id), str.c_str());
37 /* OK, its UUID, probably */
39 if (uuid_parse (str.c_str(), id)) {
49 ID::print (char* buf) const
51 uuid_unparse (id, buf);
55 ID::operator= (string str)
62 ID::operator== (const ID& other) const
64 return memcmp (id, other.id, sizeof (id)) == 0;
68 operator<< (ostream& ostr, const ID& id)