ossp-pkg/uuid/uuid++.cc 1.5 -> 1.6
--- uuid++.cc 2006/01/13 06:44:30 1.5
+++ uuid++.cc 2006/05/11 09:37:27 1.6
@@ -243,12 +243,13 @@
return;
}
-/* method: import string representation */
+/* method: import string or single integer value representation */
void uuid::import(const char *str)
{
uuid_rc_t rc;
if ((rc = uuid_import(ctx, UUID_FMT_STR, str, UUID_LEN_STR)) != UUID_RC_OK)
- throw uuid_error_t(rc);
+ if ((rc = uuid_import(ctx, UUID_FMT_SIV, str, UUID_LEN_SIV)) != UUID_RC_OK)
+ throw uuid_error_t(rc);
return;
}
@@ -271,6 +272,16 @@
throw uuid_error_t(rc);
return str;
}
+
+/* method: export single integer value representation */
+char *uuid::integer(void)
+{
+ uuid_rc_t rc;
+ char *str = NULL;
+ if ((rc = uuid_export(ctx, UUID_FMT_SIV, (void **)&str, NULL)) != UUID_RC_OK)
+ throw uuid_error_t(rc);
+ return str;
+}
/* method: export textual summary representation */
char *uuid::summary(void)
|
|