56 {
return substr(0,
findEx(
","));}
60 std::string::size_type pos =
findEx(
",");
64 return substr(pos + 1);
77 std::string::size_type pos = Primary.
findEx(
"=");
79 if (pos == std::string::npos)
return "";
89 std::stringstream tmp(Index);
105 const bool & unescape)
const
109 std::string::size_type open =
findEx(
"[");
112 for (i = 0; i < pos && open != std::string::npos; i++)
113 open =
findEx(
"[", open + 1);
115 std::string::size_type close =
findEx(
"]", open + 1);
117 if (open == std::string::npos || close == std::string::npos)
return "";
123 return Primary.substr(open + 1, close - open - 1);
128 #define toBeEscaped "\\[]=,>"
129 std::string Escaped(name);
130 std::string::size_type pos = Escaped.find_first_of(
toBeEscaped);
132 while (pos != std::string::npos)
134 Escaped.insert(pos,
"\\");
145 std::string Unescaped(name);
146 std::string::size_type pos = Unescaped.find(
"\\");
148 while (pos != std::string::npos)
150 Unescaped.erase(pos, 1);
152 pos = Unescaped.find(
"\\", pos);
158 std::string::size_type
160 const std::string::size_type & pos)
const
162 std::string::size_type where = find_first_of(toFind, pos);
164 std::string::size_type tmp;
166 while (where && where != std::string::npos)
168 tmp = find_last_not_of(
"\\", where - 1);
170 if ((where - tmp) % 2)
173 where = find_first_of(toFind, where + 1);
size_t getElementIndex(const size_t &pos=0) const
CCopasiObjectName getRemainder() const
static std::set< CRegisteredObjectName * > mSet
std::string getObjectType() const
static std::string unescape(const std::string &name)
static std::string escape(const std::string &name)
CCopasiObjectName getPrimary() const
std::string getElementName(const size_t &pos, const bool &unescape=true) const
std::string::size_type findEx(const std::string &toFind, const std::string::size_type &pos=0) const
std::string getObjectName() const