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

Provide regex using conf file. More...

#include <regexConfProvider.hpp>

Collaboration diagram for RegexConfProvider:
Collaboration graph

Public Member Functions

 RegexConfProvider (const bool isVerbosityDebug=false)
 Constructor to set verbosity level.
 
void maybeLoad (const std::string &identity)
 Check if identity already loaded in RegexMap, if not load them. More...
 
void maybeLoad (const std::string &identity, std::istringstream &stream)
 
const char * getRegexValue (const std::string &name, const std::string &key)
 Get the regex as string from the RegexMap. More...
 

Private Member Functions

bool getRegexConfStream (const std::string &identity, std::ifstream &stream)
 Get file stream for regex conf file. More...
 

Private Attributes

bool _isVerbosityDebug
 

Static Private Attributes

static std::map< std::string, RegexMap > _regexMapMap = {}
 Map to store RegexMap with a string key. More...
 

Detailed Description

Provide regex using conf file.

Definition at line 26 of file regexConfProvider.hpp.

Member Function Documentation

◆ getRegexConfStream()

bool RegexConfProvider::getRegexConfStream ( const std::string &  identity,
std::ifstream &  stream 
)
private

Get file stream for regex conf file.

Parameters
[in]identityName of file to be found (without ".conf" extension)
[out]streamInput file stream created from identity
Returns
True on success, false otherwise

Definition at line 82 of file regexConfProvider.cc.

◆ getRegexValue()

const char * RegexConfProvider::getRegexValue ( const std::string &  name,
const std::string &  key 
)

Get the regex as string from the RegexMap.

Parameters
identityIdentity from which the map was loaded
keyKey of the regex value required
Returns
Regex value as a null terminated string

Definition at line 157 of file regexConfProvider.cc.

◆ maybeLoad()

void RegexConfProvider::maybeLoad ( const std::string &  identity)

Check if identity already loaded in RegexMap, if not load them.

Parameters
identityIdentity to be matched

Definition at line 99 of file regexConfProvider.cc.

Member Data Documentation

◆ _isVerbosityDebug

bool RegexConfProvider::_isVerbosityDebug
private

True to print debug messages

Definition at line 41 of file regexConfProvider.hpp.

◆ _regexMapMap

map< string, RegexMap > RegexConfProvider::_regexMapMap = {}
staticprivate

Map to store RegexMap with a string key.

Where key is the identity file name from which the RegexMap is loaded and value is the RegexMap from the identity file

Definition at line 39 of file regexConfProvider.hpp.


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