libdrmconf  0.10.4
A library to program DMR radios.
Public Types | Public Member Functions | Protected Attributes | List of all members
RadioLimitString Class Reference

Checks a string valued property. More...

#include <radiolimits.hh>

Inheritance diagram for RadioLimitString:
Inheritance graph
[legend]
Collaboration diagram for RadioLimitString:
Collaboration graph
[legend]

Public Types

enum  Encoding { 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. More...
 
bool verify (const ConfigItem *item, const QMetaProperty &prop, RadioLimitContext &context) const
 Verifies the given property of the specified item. More...
 
- Public Member Functions inherited from RadioLimitElement
virtual ~RadioLimitElement ()
 Destructor.
 

Protected Attributes

int _minLen
 Holds the minimum length of the string. More...
 
int _maxLen
 Holds the maximum length of the string. More...
 
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
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: