FOSSology  4.4.0
Open Source License Compliance by Open Source Software
regexConfParser.cc File Reference

Handles RegexMap related requests. More...

#include "regexConfParser.hpp"
#include <string>
#include <iostream>
Include dependency graph for regexConfParser.cc:

Go to the source code of this file.

Macros

#define RGX_SEPARATOR_LEFT   "__"
 
#define RGX_SEPARATOR_RIGHT   RGX_SEPARATOR_LEFT
 
#define RGX_SEPARATOR_LEN   2
 

Functions

RegexMap readConfStreamToMap (std::istringstream &stream, const bool isVerbosityDebug)
 Read a string stream and crate a RegexMap. More...
 
RegexMap readConfStreamToMap (std::ifstream &stream, const bool isVerbosityDebug)
 
void addRegexToMap (RegexMap &regexMap, const std::string &regexDesc, const bool isVerbosityDebug)
 Given a single line as 'key=value' pair, create a RegexMap. More...
 
string replaceTokens (RegexMap &regexMap, const string &constInput)
 Removes tokens separated by RGX_SEPARATOR_LEFT in constInput using regexMap. More...
 

Detailed Description

Handles RegexMap related requests.

Definition in file regexConfParser.cc.

Function Documentation

◆ addRegexToMap()

void addRegexToMap ( RegexMap &  regexMap,
const std::string &  regexDesc,
const bool  isVerbosityDebug 
)

Given a single line as 'key=value' pair, create a RegexMap.

Parameters
[out]regexMapMap to add pairs
[in]regexDescString containing the pair to be added
[in]isVerbosityDebugPrint debug messages if true

Definition at line 53 of file regexConfParser.cc.

◆ readConfStreamToMap() [1/2]

RegexMap readConfStreamToMap ( std::ifstream &  stream,
const bool  isVerbosityDebug 
)

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

Definition at line 36 of file regexConfParser.cc.

◆ readConfStreamToMap() [2/2]

RegexMap readConfStreamToMap ( std::istringstream &  stream,
const bool  isVerbosityDebug 
)

Read a string stream and crate a RegexMap.

Parameters
streamString stream to read from
isVerbosityDebugPrint debug messages if true
Returns
RegexMap created using stream

Definition at line 23 of file regexConfParser.cc.

◆ replaceTokens()

string replaceTokens ( RegexMap &  regexMap,
const string &  constInput 
)

Removes tokens separated by RGX_SEPARATOR_LEFT in constInput using regexMap.

Parameters
[in]regexMapMap to be used for removal
[in]constInputInput which has to be removed
Returns
String with tokens removed

Definition at line 89 of file regexConfParser.cc.