34 std::string::size_type pos;
36 for (pos = 0; pos <
id.length(); pos++)
38 id.find_first_not_of(
"0123456789abcdefABCDEF", pos + 1) > pos + 2)
41 ascii[0] = (
unsigned char) strtol(
id.substr(pos + 1 , 2).c_str(), NULL, 16);
53 std::string::size_type begin = Id.find_first_not_of(
"\x20\x09\x0d\x0a");
55 if (begin == std::string::npos)
61 std::string::size_type end =
id.find_last_not_of(
"\x20\x09\x0d\x0a");
63 if (end == std::string::npos)
64 Id =
id.substr(begin);
66 Id =
id.substr(begin, end - begin + 1);
96 mResource(src.mResource),
142 if (URL ==
"http://identifiers.org/unknown")
147 return URL +
"/" +
mId;
220 if (URI.substr(0, pTmp->length()) == *pTmp &&
221 URI.length() > pTmp->length())
223 offset = (pTmp->at(pTmp->length() - 1) ==
'/') ? 0 : 1;
224 mId = URI.substr(pTmp->length() + offset);
231 if (URI.substr(0, Tmp.length()) == Tmp &&
232 URI.length() > Tmp.length())
234 offset = (Tmp[Tmp.length() - 1] ==
'/') ? 0 : 1;
235 mId = URI.substr(Tmp.length() + offset);
246 for (; itDeprecated != endDeprecated; ++itDeprecated)
247 if (URI.substr(0, (*itDeprecated)->getValue().pSTRING->length()) == *(*itDeprecated)->getValue().pSTRING &&
248 URI.length() > (*itDeprecated)->getValue().pSTRING->length())
250 const std::string& uri = *(*itDeprecated)->getValue().pSTRING;
251 offset = (uri[uri.length() - 1] ==
'/') ? 0 : 1;
252 mId = URI.substr(uri.length() + offset);
const std::string & getMIRIAMURI() const
size_t getResource(const std::string &URI)
static const CMIRIAMResources * mpResources
std::string getIdentifiersOrgURL() const
static void setMIRIAMResources(const CMIRIAMResources *pResources)
const CMIRIAMResource & getMIRIAMResource(const size_t index) const
std::string getURI() const
virtual ~CMIRIAMResourceObject()
static void unescapeId(std::string &id)
index_iterator endIndex() const
bool setURI(const std::string &URI)
bool setId(const std::string &id)
bool setDisplayName(const std::string &displayName)
bool setNode(CRDFNode *pNode)
CRDFNode * getNode() const
static std::string trimId(const std::string &id)
static const CMIRIAMResources & getResourceList()
std::string getDisplayName() const
index_iterator beginIndex() const
std::string getIdentifiersOrgURL() const
size_t getResourceIndexFromDisplayName(const std::string &displayName) const
const std::string & getId() const
void extractId(const std::string &URI)
size_t getMIRIAMResourceIndex(const std::string &URI) const
static std::string utf8(const std::string &str)
parameterGroup::iterator index_iterator
const std::string & getResource() const