libdrmconf 0.12.1
A library to program DMR radios.
Loading...
Searching...
No Matches
RadioLimitString Class Reference

Checks a string valued property. More...

#include <radiolimits.hh>

Inheritance diagram for RadioLimitString:
Collaboration diagram for RadioLimitString:

Public Types

enum  Encoding { DTMF , ASCII , Unicode }
 Possible encoding of strings. More...
 
- Public Types inherited from RadioLimitElement
typedef std::initializer_list< std::pair< QString, RadioLimitElement * > > PropList
 Initializer lists of ConfigItem properties.
 

Public Member Functions

 RadioLimitString (int minLen, int maxLen, Encoding enc, QObject *parent=nullptr)
 Constructor.
 
bool verify (const ConfigItem *item, const QMetaProperty &prop, RadioLimitContext &context) const
 Verifies the given property of the specified item.
 
- Public Member Functions inherited from RadioLimitElement
virtual ~RadioLimitElement ()
 Destructor.
 

Protected Attributes

int _minLen
 Holds the minimum length of the string.
 
int _maxLen
 Holds the maximum length of the string.
 
Encoding _encoding
 Holds the allowed character encoding.
 

Additional Inherited Members

- Protected Member Functions inherited from RadioLimitValue
 RadioLimitValue (QObject *parent=nullptr)
 Hidden constructor.
 
- Protected Member Functions inherited from RadioLimitElement
 RadioLimitElement (QObject *parent=nullptr)
 Hidden constructor.
 

Detailed Description

Checks a string valued property.

Instances of this class can be used to verify string values. That is, checking the length of the string and its encoding.

Member Enumeration Documentation

◆ Encoding

Possible encoding of strings.

Enumerator
DTMF 

Just DTMF symbols are allowed (0-9, A-D, *, #).

ASCII 

Just ASCII is allowed.

Unicode 

Any Unicode character is allowed.

Constructor & Destructor Documentation

◆ RadioLimitString()

RadioLimitString::RadioLimitString ( int minLen,
int maxLen,
Encoding enc,
QObject * parent = nullptr )

Constructor.

Parameters
minLenSpecifies the minimum length of the string. If -1, check is disabled.
maxLenSpecifies the maximum length of the string. If -1, check is disabled.
encSpecifies the allowed string encoding.
parentSpecifies the QObject parent object.

Member Function Documentation

◆ verify()

bool RadioLimitString::verify ( const ConfigItem * item,
const QMetaProperty & prop,
RadioLimitContext & context ) const
virtual

Verifies the given property of the specified item.

This method gets implemented by the specialized classes to implement the actual verification.

Implements RadioLimitElement.

Member Data Documentation

◆ _maxLen

int RadioLimitString::_maxLen
protected

Holds the maximum length of the string.

If -1, the check is disabled.

◆ _minLen

int RadioLimitString::_minLen
protected

Holds the minimum length of the string.

If -1, the check is disabled.


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