retdec
Private Types | Private Attributes | List of all members
retdec::fileinfo::Pattern Class Reference

#include <pattern.h>

Collaboration diagram for retdec::fileinfo::Pattern:
Collaboration graph
[legend]

Public Member Functions

Query methods
bool isLittle () const
 
bool isBig () const
 
Getters
std::string getName () const
 
std::string getDescription () const
 
std::string getYaraRuleName () const
 
std::size_t getNumberOfMatches () const
 
const PatternMatchgetMatch (std::size_t index) const
 
const std::vector< PatternMatch > & getMatches () const
 
Iterators
patternMatchConstIterator begin () const
 
patternMatchConstIterator end () const
 
patternMatchIterator begin ()
 
patternMatchIterator end ()
 
Setters
void setName (std::string sName)
 
void setDescription (std::string sDescription)
 
void setYaraRuleName (std::string sYaraRuleName)
 
void setLittle ()
 
void setBig ()
 
Other methods
void addMatch (PatternMatch &match)
 

Private Types

using patternMatchConstIterator = std::vector< PatternMatch >::const_iterator
 
using patternMatchIterator = std::vector< PatternMatch >::iterator
 

Private Attributes

std::string name
 name of pattern More...
 
std::string description
 description of pattern More...
 
std::string yaraRuleName
 set name of YARA rule More...
 
bool little = false
 true if pattern is little endian More...
 
bool big = false
 true if pattern is big endian More...
 
std::vector< PatternMatchmatches
 all matches of pattern More...
 

Detailed Description

Class for information about detected pattern

Member Typedef Documentation

◆ patternMatchConstIterator

using retdec::fileinfo::Pattern::patternMatchConstIterator = std::vector<PatternMatch>::const_iterator
private

◆ patternMatchIterator

using retdec::fileinfo::Pattern::patternMatchIterator = std::vector<PatternMatch>::iterator
private

Member Function Documentation

◆ addMatch()

void retdec::fileinfo::Pattern::addMatch ( PatternMatch match)

Add detected match

Parameters
matchDetected match

◆ begin() [1/2]

Pattern::patternMatchIterator retdec::fileinfo::Pattern::begin ( )

Get begin matches iterator

◆ begin() [2/2]

Pattern::patternMatchConstIterator retdec::fileinfo::Pattern::begin ( ) const

Get const begin matches iterator

◆ end() [1/2]

Pattern::patternMatchIterator retdec::fileinfo::Pattern::end ( )

Get end matches iterator

◆ end() [2/2]

Pattern::patternMatchConstIterator retdec::fileinfo::Pattern::end ( ) const

Get const end matches iterator

◆ getDescription()

std::string retdec::fileinfo::Pattern::getDescription ( ) const

Get description of pattern

Returns
Description of pattern

◆ getMatch()

const PatternMatch * retdec::fileinfo::Pattern::getMatch ( std::size_t  index) const

Get selected pattern match

Parameters
indexIndex of selected match (0..x)
Returns
Pointer to selected match or nullptr if index is out of range

◆ getMatches()

const std::vector< PatternMatch > & retdec::fileinfo::Pattern::getMatches ( ) const

Get all matches

Returns
All detected matches

◆ getName()

std::string retdec::fileinfo::Pattern::getName ( ) const

Get name of pattern

Returns
Name of pattern

◆ getNumberOfMatches()

std::size_t retdec::fileinfo::Pattern::getNumberOfMatches ( ) const

Get number of detected matches

Returns
Number of detected matches

◆ getYaraRuleName()

std::string retdec::fileinfo::Pattern::getYaraRuleName ( ) const

Get name of YARA rule

Returns
Name of YARA rule

◆ isBig()

bool retdec::fileinfo::Pattern::isBig ( ) const

Check if detected pattern is in big endian

Returns
true if detected pattern is in big endian, false otherwise

◆ isLittle()

bool retdec::fileinfo::Pattern::isLittle ( ) const

Check if detected pattern is in little endian

Returns
true if detected pattern is in little endian, false otherwise

◆ setBig()

void retdec::fileinfo::Pattern::setBig ( )

Set little endian

◆ setDescription()

void retdec::fileinfo::Pattern::setDescription ( std::string  sDescription)

Set description of pattern

Parameters
sDescriptionDescription of pattern

◆ setLittle()

void retdec::fileinfo::Pattern::setLittle ( )

Set little endian

◆ setName()

void retdec::fileinfo::Pattern::setName ( std::string  sName)

Set name of pattern

Parameters
sNameName of pattern

◆ setYaraRuleName()

void retdec::fileinfo::Pattern::setYaraRuleName ( std::string  sYaraRuleName)

Set name of YARA rule

Parameters
sYaraRuleNameName of YARA rule

Member Data Documentation

◆ big

bool retdec::fileinfo::Pattern::big = false
private

true if pattern is big endian

◆ description

std::string retdec::fileinfo::Pattern::description
private

description of pattern

◆ little

bool retdec::fileinfo::Pattern::little = false
private

true if pattern is little endian

◆ matches

std::vector<PatternMatch> retdec::fileinfo::Pattern::matches
private

all matches of pattern

◆ name

std::string retdec::fileinfo::Pattern::name
private

name of pattern

◆ yaraRuleName

std::string retdec::fileinfo::Pattern::yaraRuleName
private

set name of YARA rule


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