retdec
Public Member Functions | Private Attributes | List of all members
retdec::loader::NameGenerator Class Reference

#include <name_generator.h>

Collaboration diagram for retdec::loader::NameGenerator:
Collaboration graph
[legend]

Public Member Functions

 NameGenerator (char fill='0', std::uint32_t numWidth=0)
 
 NameGenerator (const std::string &prefix, char fill=' ', std::uint32_t numWidth=0)
 
std::string getNextName ()
 

Private Attributes

std::string _prefix
 
char _fill
 
std::uint32_t _numWidth
 
std::uint32_t _counter
 

Detailed Description

This class represents the unique name generator, where uniqueness is achieved through increasing sequence of numbers starting from 0. Name generator can be given prefix string, which is prepended to numbers from sequence.

Constructor & Destructor Documentation

◆ NameGenerator() [1/2]

retdec::loader::NameGenerator::NameGenerator ( char  fill = '0',
std::uint32_t  numWidth = 0 
)

Creates name generator with no prefix and optionally can be given fill character and number width.

Parameters
fillThe character that is used to fill the width of number.
numWidthThe width of the number.

◆ NameGenerator() [2/2]

retdec::loader::NameGenerator::NameGenerator ( const std::string &  prefix,
char  fill = ' ',
std::uint32_t  numWidth = 0 
)

Creates name generator with specified prefix and optionally can be given fill character and number width.

Parameters
prefixThe prefix of the name.
fillThe character that is used to fill the width of number.
numWidthThe width of the number.

Member Function Documentation

◆ getNextName()

std::string retdec::loader::NameGenerator::getNextName ( )

Returns the next name from the sequence. Name is of string type and in format

prefix + number from sequence
Returns
The next name.

Member Data Documentation

◆ _counter

std::uint32_t retdec::loader::NameGenerator::_counter
private

◆ _fill

char retdec::loader::NameGenerator::_fill
private

◆ _numWidth

std::uint32_t retdec::loader::NameGenerator::_numWidth
private

◆ _prefix

std::string retdec::loader::NameGenerator::_prefix
private

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