ANNA Suite
2020b
Multipurpose development suite for Telco applications
|
#include <MultiRangeExpression.hpp>
Public Member Functions | |
MultiRangeExpression () | |
~MultiRangeExpression () | |
const char * | getLiteral (void) const |
std::string | getExpandedLiteral (void) const |
const char * | simplifyLiteral (void) |
bool | contain (const unsigned int &value) const |
void | setLiteral (const char *l) |
void | addLiteral (const char *l) |
Class helper to manage multi-range expression like '1-4,23,45-46' (1,2,3,4,23,45,46)
|
inline |
Accumulates the provided literal over the stored literal You could simplify with simplifyLiteral, because perhaps there is overlapping between current literal and provided one.
l | Literal to be added |
|
inline |
std::string anna::MultiRangeExpression::getExpandedLiteral | ( | void | ) | const |
Gets expanded representation for stored literal. E.g.: '1-3,8,10' => '1,2,3,7,8,10'
|
inline |
Gets the configured literal by mean setLiteral or addLiteral
|
inline |
const char* anna::MultiRangeExpression::simplifyLiteral | ( | void | ) |
Simplify stored literal. E.g.: '1,1,1,2,3,7,8,10' => '1-3,8,10' and returns it.