My favorites | Sign in
Project Home Downloads Source
Checkout   Browse   Changes    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
struct Uuid : AssignValueTypeNo<Uuid, 50, Moveable<Uuid> > {
dword a, b, c, d;

void Serialize(Stream& s);
void Xmlize(XmlIO& xio);
void Jsonize(JsonIO& jio);
bool IsNullInstance() const { return a == 0 && b == 0 && c == 0 && d == 0; }
void SetNull() { a = b = c = d = 0; }

#ifdef SVO_VALUE
operator Value() const { return RichToValue(*this); }
Uuid(const Value& q) { *this = q.Get<Uuid>(); }
#else
operator Value() const { return RichValue<Uuid>(*this); }
Uuid(const Value& q) { *this = RichValue<Uuid>::Extract(q); }
#endif
Uuid(const Nuller&) { SetNull(); }
Uuid() {}

unsigned GetHashValue() const { return CombineHash(a, b, c, d); }
String ToString() const;
String ToStringWithDashes() const;

void New() { *this = Create(); }

static Uuid Create();
};

String Format(const Uuid& id);
String FormatWithDashes(const Uuid& id);
Uuid ScanUuid(const char *s);

inline bool operator==(const Uuid& u, const Uuid& w) {
return ((u.a ^ w.a) | (u.b ^ w.b) | (u.c ^ w.c) | (u.d ^ w.d)) == 0;
}

inline bool operator!=(const Uuid& u, const Uuid& w) {
return !(u == w);
}

template<>
inline String AsString(const Uuid& id) { return Format(id); }

ValueGen& UuidValueGen();

Change log

r4654 by cxl on Mar 3, 2012   Diff
Core: Jsonize finished
Go to: 
Project members, sign in to write a code review

Older revisions

r4651 by cxl on Mar 3, 2012   Diff
Core: Value support for Xmlize,
Jasonize
r4495 by cxl on Jan 30, 2012   Diff
Core: new Value reintegrated for
conditional compilation (SVO_VALUE
flag)
r3866 by cxl on Sep 16, 2011   Diff
uppsrc: Null cleanup
All revisions of this file

File info

Size: 1295 bytes, 44 lines

File properties

svn:eol-style
native
Powered by Google Project Hosting