8 #include "Reflex/Reflex.h"
13 static const char*
fmt_oid =
"[OID=%08X-%08X]";
14 static const char*
guid_null =
"00000000-0000-0000-0000-000000000000";
17 if( source.empty() )
ora::throwException(
"Provided token is empty.",
"PoolToken::parseToken");
19 std::pair<std::string,int> oid;
22 for(
char*
p1 = (
char*)tmp.c_str();
p1;
p1 = ::strchr(++
p1,
'[')) {
23 char*
p2 = ::strchr(
p1,
'=');
24 char*
p3 = ::strchr(
p1,
']');
27 if ( ::strncmp(
"[DB=",
p1, 4) == 0 ) {
29 }
else if ( ::strncmp(
"[CNT=",
p1, 5) == 0 ) {
32 }
else if ( ::strncmp(
fmt_oid,
p1, 5) == 0 ) {
45 std::string
writeToken(
const std::string& containerName,
51 ::sprintf(text,
fmt_oid, oid0, oid1);
60 std::string clguid(
"");
62 Reflex::Type containerType = Reflex::Type::ByName( className );
64 Reflex::PropertyList props = containerType.Properties();
65 if( props.HasProperty(
"ClassID")){
66 clguid = props.PropertyAsString(
"ClassID");
72 Guid* gd =
reinterpret_cast<Guid*
>(buff);
77 std::string str =
"[DB="+std::string(
guid_null)+
"][CNT=" + containerName +
"][CLID="+clguid+
"]";
std::string toString() const
std::pair< std::string, int > parseToken(const std::string &objectId)
static const char * fmt_oid
std::string writeTokenContainerFragment(const std::string &containerName, const std::string &className)
static const char * fmt_tech
void * genMD5(void *buffer, unsigned long len, void *code)
static const char * guid_null
std::vector< std::vector< double > > tmp
void throwException(const std::string &message, const std::string &methodName)
char const * className(const std::type_info &t)
std::string writeToken(const std::string &containerName, int oid0, int oid1, const std::string &className)