8 #include "copyscan.hpp"
11 #include "regexConfProvider.hpp"
13 const string copyrightType(
"statement");
26 rx::regex_constants::icase);
29 rx::regex_constants::icase);
33 rx::regex_constants::icase);
35 rx::regex_constants::icase);
49 string::const_iterator begin =
s.begin();
50 string::const_iterator pos = begin;
51 string::const_iterator end =
s.end();
59 string::const_iterator foundPos = results[0].first;
73 string::const_iterator j = find(foundPos, end,
'\n');
76 string::const_iterator beginOfLine = j;
78 string::const_iterator endOfLine = find(beginOfLine, end,
'\n');
84 || !rx::regex_match(beginOfLine, endOfLine,
regNonBlank))
91 if (j - foundPos >= 301)
93 out.push_back(
match(foundPos - begin, (foundPos - begin) + 300, copyrightType));
96 out.push_back(
match(foundPos - begin, j - begin, copyrightType));
103 pos = results[0].second;
Provide regex using conf file.
void maybeLoad(const std::string &identity)
Check if identity already loaded in RegexMap, if not load them.
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.
rx::regex regSpdxCopyright
hCopyrightScanner()
Constructor for default hCopyrightScanner.
rx::regex regSimpleCopyright
int s
The socket that the CLI will use to communicate.
list_t type structure used to keep various lists. (e.g. there are multiple lists).
Store the results of a regex match.