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

#include <flags.h>

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

Public Member Functions

Getters
unsigned long long getSize () const
 
unsigned long long getFlags () const
 
std::string getFlagsStr () const
 
std::size_t getNumberOfDescriptors () const
 
void getDescriptors (std::vector< std::string > &desc, std::vector< std::string > &abb) const
 
Setters
void setSize (unsigned long long flagsSize)
 
void setFlags (unsigned long long flags)
 
Other methods
void addDescriptor (std::string descriptor, std::string abbreviation)
 
void clearDescriptors ()
 

Private Attributes

unsigned long long size = 0
 size of bit array More...
 
unsigned long long flagsArray = 0
 array of flags More...
 
std::vector< std::string > descriptors
 descriptors of flags More...
 
std::vector< std::string > abbs
 abbreviations of descriptors More...
 

Detailed Description

Flags class

Member Function Documentation

◆ addDescriptor()

void retdec::fileinfo::Flags::addDescriptor ( std::string  descriptor,
std::string  abbreviation 
)

Add flag descriptor

Parameters
descriptorDescriptor (full description of flag)
abbreviationAbbreviation (short description of flag)

◆ clearDescriptors()

void retdec::fileinfo::Flags::clearDescriptors ( )

Delete every descriptors and its abbreviations

◆ getDescriptors()

void retdec::fileinfo::Flags::getDescriptors ( std::vector< std::string > &  desc,
std::vector< std::string > &  abb 
) const

Get flags descriptors and its abbreviations

Parameters
descVector for save descriptors
abbVector for save abbreviations of descriptors

The first element in abb corresponds to the first element in desc etc. Before loading descriptors, everything from vectors desc and abb is deleted. It is guaranteed that the number of stored descriptors and abbreviations are the same.

◆ getFlags()

unsigned long long retdec::fileinfo::Flags::getFlags ( ) const

Get binary flags

Returns
Flags as one number

◆ getFlagsStr()

std::string retdec::fileinfo::Flags::getFlagsStr ( ) const

Get flags as string

Returns
Flags in string representation

◆ getNumberOfDescriptors()

std::size_t retdec::fileinfo::Flags::getNumberOfDescriptors ( ) const

Get number of descriptors and its abbreviations

Returns
Number of descriptors

It is guaranteed that the number of descriptors and abbreviations are the same

◆ getSize()

unsigned long long retdec::fileinfo::Flags::getSize ( ) const

Get number of flags

Returns
Number of binary flags

◆ setFlags()

void retdec::fileinfo::Flags::setFlags ( unsigned long long  flags)

Set flags

Parameters
flagsFlags

◆ setSize()

void retdec::fileinfo::Flags::setSize ( unsigned long long  flagsSize)

Set flags size (number of flags)

Parameters
flagsSizeNumber of binary flags

Maximum permissible value of parameter flagsSize is bit-width of unsigned long long int type. If value of flagsSize is greater, it will be automatically reduce to the maximum permissible value.

Member Data Documentation

◆ abbs

std::vector<std::string> retdec::fileinfo::Flags::abbs
private

abbreviations of descriptors

◆ descriptors

std::vector<std::string> retdec::fileinfo::Flags::descriptors
private

descriptors of flags

◆ flagsArray

unsigned long long retdec::fileinfo::Flags::flagsArray = 0
private

array of flags

◆ size

unsigned long long retdec::fileinfo::Flags::size = 0
private

size of bit array


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