2 #include "boost/algorithm/string.hpp" 11 std::regex
const typeRE(
"^(?:[[:alnum:]]|::)*");
12 std::regex
const typeSelectorRE(
"^(?:[[:alnum:]\\*\\?]|::)*");
13 std::regex
const labelRE(
"^[[:alnum:]#]*");
14 std::regex
const labelSelectorRE(
"^[[:alnum:]#\\*\\?]*");
15 std::regex
const processRE(
"^[[:alnum:]]*");
16 std::regex
const processSelectorRE(
"^[[:alnum:]\\*\\?]*");
19 checkBranchNameComponent(
std::string const& component,
26 if (component.empty()) {
28 errMsg +=
"Illegal empty " + designation +
".\n";
33 std::regex_search(component, sm, re) && sm.suffix().str().empty();
35 errMsg +=
"Illegal character(s) found in " + designation +
"\n " +
36 component +
"\n" +
std::string(2ul + sm.length(),
' ') +
'^' +
37 std::string(component.length() - sm.length(),
' ') +
38 "(first infraction marked).\n";
49 std::vector<std::string> parts;
51 if (parts.size() != 4) {
52 errMsg +=
"Illegal product name specification \"" + branchName +
"\".\n";
87 return checkBranchNameComponent(
88 friendlyName,
"friendly name", typeRE, errMsg);
95 return checkBranchNameComponent(
96 friendlyNameSelector,
"friendly name", typeSelectorRE, errMsg);
103 return checkBranchNameComponent(moduleLabel,
"module label", labelRE, errMsg);
110 return checkBranchNameComponent(
111 moduleLabelSelector,
"module label", labelSelectorRE, errMsg);
118 return checkBranchNameComponent(instanceName,
129 return checkBranchNameComponent(instanceNameSelector,
140 return checkBranchNameComponent(
141 processName,
"process name", processRE, errMsg);
148 return checkBranchNameComponent(
149 processNameSelector,
"process name", processSelectorRE, errMsg);
bool checkModuleLabelSelector(std::string const &moduleLabelSelector, std::string &errMsg)
bool checkBranchNameSelector(std::string const &branchNameSelector, std::string &errMsg)
bool checkInstanceNameSelector(std::string const &instanceNameSelector, std::string &errMsg)
BranchKey splitToComponents(std::string const &branchName, std::string &errMsg)
std::string productInstanceName_
bool checkInstanceName(std::string const &instanceName, std::string &errMsg)
std::string friendlyClassName_
bool checkProcessNameSelector(std::string const &processNameSelector, std::string &errMsg)
bool checkFriendlyNameSelector(std::string const &friendlyNameSelector, std::string &errMsg)
std::string friendlyName(std::string const &iFullName)
bool checkFriendlyName(std::string const &friendlyName, std::string &errMsg)
bool checkProcessName(std::string const &processName, std::string &errMsg)
void split(std::string const &s, char c, OutIter dest)
bool checkModuleLabel(std::string const &moduleLabel, std::string &errMsg)