FOSSology  4.4.0
Open Source License Compliance by Open Source Software
regscan.hpp
1 /*
2  SPDX-FileCopyrightText: © 2015 Siemens AG
3  Author: Florian Krügel
4 
5  SPDX-License-Identifier: GPL-2.0-only
6 */
7 
8 #ifndef REGSCAN_HPP_
9 #define REGSCAN_HPP_
10 
11 #include "scanners.hpp"
12 #include "regex.hpp"
13 #include "regexConfProvider.hpp"
14 #include <sstream>
15 
20 class regexScanner : public scanner
21 {
26  rx::regex _reg;
33  const string _type, _identity;
38  int _index;
39 
40 public:
41  void ScanString(const string& str, list<match>& results) const;
42 
43  regexScanner(const string& type,
44  const string& identity,
45  int index = 0);
46  regexScanner(const string& type,
47  std::istringstream& stream,
48  int index = 0);
49 } ;
50 
51 
52 #endif
53 
Provides a regex scanner using predefined regexs.
Definition: regscan.hpp:21
const string _identity
Definition: regscan.hpp:33
rx::regex _reg
Definition: regscan.hpp:26
const string _type
Definition: regscan.hpp:33
regexScanner(const string &type, const string &identity, int index=0)
Initialize RegexConfProvider and regex based on type and identity.
Definition: regscan.cc:14
void ScanString(const string &str, list< match > &results) const
Scan a string using regex defined during initialization.
Definition: regscan.cc:51
Abstract class to provide interface to scanners.
Definition: scanners.hpp:52
Utilities to help scanners.
list_t type structure used to keep various lists. (e.g. there are multiple lists).
Definition: nomos.h:308