retdec
Public Member Functions | Protected Member Functions | List of all members
retdec::fileinfo::DynamicSectionsPlainGetter Class Reference

#include <dynamic_sections_plain_getter.h>

Inheritance diagram for retdec::fileinfo::DynamicSectionsPlainGetter:
Inheritance graph
[legend]
Collaboration diagram for retdec::fileinfo::DynamicSectionsPlainGetter:
Collaboration graph
[legend]

Public Member Functions

 DynamicSectionsPlainGetter (FileInformation &fileInfo)
 
virtual std::size_t getBasicInfo (std::size_t structIndex, std::vector< std::string > &desc, std::vector< std::string > &info) const override
 
virtual bool getFlagDescriptors (std::size_t structIndex, std::vector< std::string > &desc, std::vector< std::string > &abbv) const override
 
- Public Member Functions inherited from retdec::fileinfo::IterativeDistributionGetter
 IterativeDistributionGetter (FileInformation &fileInfo)
 
std::size_t getDistribution (std::size_t structIndex, std::vector< std::size_t > &distr) const
 
std::size_t getHeaderDesc (std::size_t structIndex, std::vector< std::string > &desc, std::vector< std::string > &abb) const
 
void getHeader (std::size_t structIndex, std::string &header) const
 
bool getDistributionFlags (std::size_t structIndex, std::vector< bool > &flags) const
 
virtual bool getRecord (std::size_t structIndex, std::size_t recIndex, std::vector< std::string > &record) const override
 
- Public Member Functions inherited from retdec::fileinfo::IterativeGetter
 IterativeGetter (FileInformation &fileInfo)
 
std::size_t getNumberOfStructures () const
 
std::size_t getNumberOfStoredRecords (std::size_t structIndex) const
 
std::size_t getHeaderElements (std::size_t structIndex, std::vector< std::string > &elements) const
 
void getTitle (std::string &structTitle) const
 
bool hasBasicInfo (std::size_t structIndex) const
 

Protected Member Functions

virtual bool loadRecord (std::size_t structIndex, std::size_t recIndex, std::vector< std::string > &record) override
 
- Protected Member Functions inherited from retdec::fileinfo::IterativeDistributionGetter
void loadRecords ()
 

Additional Inherited Members

- Protected Attributes inherited from retdec::fileinfo::IterativeDistributionGetter
std::vector< std::vector< std::vector< std::string > > > records
 records from all structures More...
 
std::vector< std::size_t > distribution
 distribution of header (common for all structures) More...
 
std::vector< std::string > commonHeaderDesc
 description of header elements (common for all structures) More...
 
std::vector< std::vector< std::size_t > > extraDistribution
 distribution of extra elements for each structure More...
 
std::vector< std::vector< std::string > > extraDesc
 description of extra header elements for each structure More...
 
std::vector< std::vector< bool > > distFlags
 distribution flags More...
 
std::vector< std::vector< bool > > hexMap
 map of hexadecimal elements (columns) More...
 
std::vector< std::vector< std::size_t > > hexPadding
 padding of hexadecimal columns More...
 
- Protected Attributes inherited from retdec::fileinfo::IterativeGetter
FileInformationfileinfo
 information about file More...
 
std::size_t numberOfStructures
 number of presented structures (e.g. number of symbol tables) More...
 
std::vector< std::size_t > numberOfStoredRecords
 number of records in each structure More...
 
std::vector< std::string > commonHeaderElements
 parts of header (common for all structures) More...
 
std::vector< std::size_t > numberOfExtraElements
 number of extra elements in each structure More...
 
std::vector< std::vector< std::string > > extraHeaderElements
 parts of header (specific for each structure) More...
 
std::string title
 title of presented structure More...
 

Detailed Description

Getter for dynamic sections

Constructor & Destructor Documentation

◆ DynamicSectionsPlainGetter()

retdec::fileinfo::DynamicSectionsPlainGetter::DynamicSectionsPlainGetter ( FileInformation fileInfo)

Constructor

Parameters
fileInfoInformation about file

Member Function Documentation

◆ getBasicInfo()

std::size_t retdec::fileinfo::DynamicSectionsPlainGetter::getBasicInfo ( std::size_t  structIndex,
std::vector< std::string > &  desc,
std::vector< std::string > &  info 
) const
overridevirtual

Get basic information about presented structure

Parameters
structIndexIndex of selected structure (indexed from 0)
descVector for save descriptions of information
infoVector for save information about file
Returns
Number of loaded information (this is equal to number of elements in desc and in info)

Before loading information, everything from vectors desc and info is deleted. If structure does not support this feature or structIndex is out of range, method returns 0 and vectors are left unchanged.

Implements retdec::fileinfo::IterativeGetter.

◆ getFlagDescriptors()

bool retdec::fileinfo::DynamicSectionsPlainGetter::getFlagDescriptors ( std::size_t  structIndex,
std::vector< std::string > &  desc,
std::vector< std::string > &  abbv 
) const
overridevirtual

Get descriptors (and its abbreviations) of all records in structure

Parameters
structIndexIndex of selected structure (indexed from 0)
descVector for save descriptors
abbvVector for save abbreviations
Returns
true if index of selected structure is valid, false otherwise. If index is not valid, desc and abbv are left unchanged.

Into desc is stored each flag descriptor, which is assigned to at least one record. Into abbv are stored abbreviations of descriptors, which are stored in desc.

Before loading descriptors, everything from vectors desc and abbv is deleted.

Implements retdec::fileinfo::IterativeDistributionGetter.

◆ loadRecord()

bool retdec::fileinfo::DynamicSectionsPlainGetter::loadRecord ( std::size_t  structIndex,
std::size_t  recIndex,
std::vector< std::string > &  record 
)
overrideprotectedvirtual

Load one record

Parameters
structIndexIndex of selected structure (indexed from 0)
recIndexIndex of record in selected structure (indexed from 0)
recordVector for save record. At end of vector are stored special additional information, if these information are present. Number and semantics of additional information may be different for every separate structure.
Returns
true if record was successfully saved, false otherwise

Before loading record, everything from vector record is deleted.

If method returns true, record contains as many elements as vector returned by the method getHeaderElements(structIndex) as well as vector returned by the method getDistribution(structIndex).

If structIndex or recIndex is out of range, method returns false.

Implements retdec::fileinfo::IterativeDistributionGetter.


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