--- deliantra/server/include/object.h 2009/11/08 22:28:10 1.217 +++ deliantra/server/include/object.h 2009/11/09 03:08:24 1.218 @@ -95,6 +95,8 @@ { uint64 seq; + enum { MAX_LEN = 3 + 16 + 1 + 1 }; // <1. + hex + > + \0 + static UUID cur; // last uuid generated static void init (); static UUID gen (); @@ -104,26 +106,9 @@ operator uint64() { return seq; } void operator =(uint64 seq) { this->seq = seq; } - typedef char BUF [32]; - - bool parse (const char *s) - { - return sscanf (s, "<1.%" SCNx64 ">", &seq) == 1; - } - - const char *c_str (char *buf, int len) const - { - snprintf (buf, len, "<1.%" PRIx64 ">", seq); - - return buf; - } - - const char *c_str () const - { - static BUF buf; - - return c_str (buf, sizeof (buf)); - } + bool parse (const char *s); + char *append (char *buf) const; + char *c_str () const; }; //+GPL