19 #include "copyscan.hpp" 22 #include "regexConfProvider.hpp" 24 const string copyrightType(
"statement");
37 rx::regex_constants::icase);
40 rx::regex_constants::icase);
44 rx::regex_constants::icase);
58 string::const_iterator begin = s.begin();
59 string::const_iterator pos = begin;
60 string::const_iterator end = s.end();
68 string::const_iterator foundPos = results[0].first;
82 string::const_iterator j = find(foundPos, end,
'\n');
85 string::const_iterator beginOfLine = j;
87 string::const_iterator endOfLine = find(beginOfLine, end,
'\n');
89 || !rx::regex_match(beginOfLine, endOfLine,
regNonBlank))
96 if (j - foundPos >= 999)
98 out.push_back(
match(foundPos - begin, (foundPos - begin) + 998, copyrightType));
101 out.push_back(
match(foundPos - begin, j - begin, copyrightType));
108 pos = results[0].second;
Provide regex using conf file.
rx::regex regSimpleCopyright
Store the results of a regex match.
int s
The socket that the CLI will use to communicate.
const char * getRegexValue(const std::string &name, const std::string &key)
Get the regex as string from the RegexMap.
void ScanString(const string &s, list< match > &results) const
Scan a given string for copyright statements.
hCopyrightScanner()
Constructor for default hCopyrightScanner.
list_t type structure used to keep various lists. (e.g. there are multiple lists).
void maybeLoad(const std::string &identity)
Check if identity already loaded in RegexMap, if not load them.