FOSSology  4.4.0
Open Source License Compliance by Open Source Software
regexScanner Class Reference

Provides a regex scanner using predefined regexs. More...

#include <regscan.hpp>

Inheritance diagram for regexScanner:
Inheritance graph
Collaboration diagram for regexScanner:
Collaboration graph

Public Member Functions

void ScanString (const string &str, list< match > &results) const
 Scan a string using regex defined during initialization. More...
 
 regexScanner (const string &type, const string &identity, int index=0)
 Initialize RegexConfProvider and regex based on type and identity. More...
 
 regexScanner (const string &type, std::istringstream &stream, int index=0)
 Initialize RegexConfProvider and regex based on type and stream. More...
 
- Public Member Functions inherited from scanner
virtual void ScanFile (const string &fileName, list< match > &results) const
 Helper function to scan file. More...
 

Private Attributes

rx::regex _reg
 
const string _type
 
const string _identity
 
int _index
 

Detailed Description

Provides a regex scanner using predefined regexs.

Definition at line 20 of file regscan.hpp.

Constructor & Destructor Documentation

◆ regexScanner() [1/2]

regexScanner::regexScanner ( const string &  type,
const string &  identity,
int  index = 0 
)

Initialize RegexConfProvider and regex based on type and identity.

See also
RegexConfProvider::maybeLoad(const std::string& identity)

Definition at line 14 of file regscan.cc.

◆ regexScanner() [2/2]

regexScanner::regexScanner ( const string &  type,
std::istringstream &  stream,
int  index = 0 
)

Initialize RegexConfProvider and regex based on type and stream.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

See also
RegexConfProvider::maybeLoad(const std::string& identity, std::istringstream& stream)

Definition at line 33 of file regscan.cc.

Member Function Documentation

◆ ScanString()

void regexScanner::ScanString ( const string &  s,
list< match > &  results 
) const
virtual

Scan a string using regex defined during initialization.

Parameters
[in]sString to scan
[out]resultsList of match results

Implements scanner.

Definition at line 51 of file regscan.cc.

Member Data Documentation

◆ _identity

string regexScanner::_identity
private

Identity of regex

Definition at line 33 of file regscan.hpp.

◆ _index

int regexScanner::_index
private

Index of regex

Definition at line 38 of file regscan.hpp.

◆ _reg

rx::regex regexScanner::_reg
private

Regex to be used during scan

Definition at line 26 of file regscan.hpp.

◆ _type

string regexScanner::_type
private

Type of regex to use

Definition at line 33 of file regscan.hpp.


The documentation for this class was generated from the following files: