FOSSology  3.2.0rc1
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 31 of file regscan.hpp.

Constructor & Destructor Documentation

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 25 of file regscan.cc.

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 44 of file regscan.cc.

Member Function Documentation

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 62 of file regscan.cc.

Member Data Documentation

string regexScanner::_identity
private

Identity of regex

Definition at line 44 of file regscan.hpp.

int regexScanner::_index
private

Index of regex

Definition at line 49 of file regscan.hpp.

rx::regex regexScanner::_reg
private

Regex to be used during scan

Definition at line 37 of file regscan.hpp.

string regexScanner::_type
private

Type of regex to use

Definition at line 44 of file regscan.hpp.


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