CFx SDK Documentation
2020SP3
|
Go to the documentation of this file.
25 #ifndef ODTRVISUNIQUEID
26 #define ODTRVISUNIQUEID
32 #include "ExGsHelpers.h"
131 virtual void append(OdAnsiString &to, OdDbStub* from)
const = 0;
139 virtual void append(OdAnsiString &to, OdDbStub* from)
const
145 OdAnsiString formatter;
146 formatter.format(
"%u", (
unsigned)from);
152 fromChr[::ExGsMakeHex(from, fromChr)] = 0;
160 OdAnsiString formatter;
165 transformer.append(formatter,
getId());
166 formatter += transformer.delimiter();
167 transformer.append(formatter,
getType());
172 formatter += transformer.delimiter();
173 transformer.append(formatter,
getData());
181 virtual OdDbStub *
makeStub(
const char *pStr)
const = 0;
196 while ((*pStr >=
'0') && (*pStr <=
'9'))
198 nVal = nVal * 10 +
OdUInt32(*pStr -
'0');
206 while (((*pStr >=
'0') && (*pStr <=
'9')) ||
207 ((*pStr >=
'a') && (*pStr <=
'f')) ||
208 ((*pStr >=
'A') && (*pStr <=
'F')))
211 if ((*pStr >=
'0') && (*pStr <=
'9'))
213 else if ((*pStr >=
'a') && (*pStr <=
'f'))
215 else if ((*pStr >=
'A') && (*pStr <=
'F'))
217 nVal = (nVal << 4) | mx;
227 const char *pStr1 = pStr;
228 const char *pStr2 =
NULL, *pStr3 =
NULL;
229 while (*pStr && !pStr3)
231 if (*pStr == untransformer.delimiter())
233 if (!pStr2) pStr2 = pStr + 1;
234 else pStr3 = pStr + 1;
240 setId(untransformer.makeStub(pStr1));
243 setData(untransformer.makeUInt64(pStr2));
247 setId(untransformer.makeUInt64(pStr1));
249 setData(untransformer.makeUInt64(pStr3));
265 #endif // ODTRVISUNIQUEID
bool operator>(const OdTrVisUniqueID &t2) const
OdTrVisUniqueID & untransform(const char *pStr, const UIDUnTransformer &untransformer=DefUIDUnTransformer())
#define OdTrVisPtrToId(ptr)
void setData(OdUInt64 nData)
#define OdTrVisIdToPtr(ptrType, id)
bool operator!=(const OdTrVisUniqueID &ui) const
void setId(const void *pId)
bool isPersistent() const
bool operator==(const OdTrVisUniqueID &ui) const
OdTrVisUniqueID(const OdTrVisUniqueID &ui)
void setUtilitary(OdUInt32 utCode=kUtilitaryID)
OdTrVisUniqueID & operator=(const OdTrVisUniqueID &ui)
bool operator>=(const OdTrVisUniqueID &t2) const
static int compare(const OdTrVisUniqueID &t1, const OdTrVisUniqueID &t2)
bool operator<=(const OdTrVisUniqueID &t2) const
OdTrVisUniqueID(OdUInt64 entryId, OdUInt32 entryType=kTransientID, OdUInt64 entryData=0)
bool operator<(const OdTrVisUniqueID &t2) const
OdAnsiString transform(const UIDTransformer &transformer=DefUIDTransformer()) const
OdDbStub * persistentId() const
OdTrVisUniqueID(const OdAnsiString &asValue, const UIDUnTransformer &untransformer=DefUIDUnTransformer())