13 std::string::size_type idx1=
input.find_first_not_of(
" \n\r\t");
14 std::string::size_type idx2=
input.find_last_not_of(
" \n\r\t");
15 if (idx1==std::string::npos || idx2==std::string::npos) {
18 return std::string(
input.substr(idx1,1+idx2-idx1));
32 if (iovString.empty())
return 0LL;
33 unsigned long long time=std::stoi(iovString);
34 return time*1000000000LL;
39 if (runString.empty())
return 0LL;
40 unsigned long long run=std::stoi(runString);
46 if (lbString.empty())
return 0LL;
47 unsigned long long lb=std::stoll(lbString.c_str());
53 const std::string
regex=
"\n";
55 return std::regex_replace(dataString,
lf,
"\\n");
62 std::string
regex=R
"delim(clid\s*=\s*"([0-9]*)")delim";
64 std::smatch clidMatch;
65 bool match=std::regex_search(addrHeaderStr, clidMatch,
re);
66 return (
match) ? std::stoi(clidMatch[1]) : -1;
71 std::string
regex=R
"delim(<typeName>\s*([^\s]+)\s*</typeName>)delim";
73 std::smatch typeMatch;
75 return (
match) ? std::string(typeMatch[1]) : std::string(
"");
81 return std::regex_replace(original,delre,
"");
85 quote(
const std::string & sentence){
87 out.reserve(sentence.size() + 2);
96 const std::string
regex=R
"delim(\\")delim";
98 return std::regex_replace(original,
re,
"\"");
103 const std::string
regex=R
"delim([\\]+)delim";
104 const std::string
replace=R
"delim(\)delim";
106 return std::regex_replace(original,
re,
replace);
128 const std::string &original{possibleNULL};
129 const std::string
regex=R
"delim( NULL)delim";
131 return std::regex_replace(original,nullre,
" null");
137 unsigned int strSize(pseudoXmlString.size());
138 unsigned int bufsize(strSize*1.1);
140 for(
size_t pos = 0;
pos != strSize; ++
pos) {
141 switch(pseudoXmlString[
pos]) {
142 case '\"':
result.append(
"\\\"");
break;
144 default:
result.append(&pseudoXmlString[
pos], 1);
break;
152 return (candidateTag.compare(0,7,
"TagInfo")==0 and
153 candidateTag.find(
'/')!=std::string::npos);
158 const std::string
regex=R
"delim(TagInfo(Major|Minor)/.*)delim";
160 return std::regex_match(candidateTag, magicx);
163 std::vector<std::string>
165 std::vector<std::string>
result;
166 std::string regex7=R
"delim(TagInfo(Major|Minor)/([^/]*)/?([^/]*)?)delim";
169 bool foundmagic=std::regex_match(
v,
x,matchmagic);
171 for (
const auto &
i:
x)
177 std::vector<std::string>
179 std::vector<std::string>
v{};
180 if (linktext.empty())
return v;
184 const std::string linkRegexStr{
"([^:]*(::[^:]*)?)(:|$)"};
188 std::sregex_token_iterator
pos(linktext.cbegin(), linktext.cend(),linkMatchSpec,{1});
189 std::sregex_token_iterator
e;
197 std::pair<std::string, std::string>
199 std::pair<std::string, std::string> pair;
200 std::string &
prefix{pair.first};
201 std::string &
target{pair.second};
202 if (tagParseResults.size() == 4){
203 prefix = tagParseResults[2];
204 target = tagParseResults[3];
206 target = tagParseResults[2];
213 const std::size_t svcType = addrHeader.find(
"service_type=\"71\"");
214 if (svcType != std::string::npos) {
215 addrHeader.replace(svcType, 17,
"service_type=\"256\"");