PLaSK library
|
Enum attribute reader class. More...
#include <plask/utils/xml/reader.hpp>
Public Member Functions | |
EnumAttributeReader (XMLReader &reader, const std::string &attr_name, bool case_sensitive=false) | |
Create enum attribute reader. | |
EnumAttributeReader & | value (std::string key, EnumT val, std::size_t min=std::numeric_limits< std::size_t >::max()) |
Add allowed parameter. | |
EnumT | require () |
Require attribute. | |
plask::optional< EnumT > | get () |
Get attribute. | |
EnumT | get (EnumT default_value) |
Get attribute with default value. | |
Protected Member Functions | |
EnumT | parse (std::string value) |
Protected Attributes | |
XMLReader & | reader |
const std::string | attr_name |
bool | case_insensitive |
std::map< std::string, EnumT > | values |
std::string | help |
Enum attribute reader class.
Definition at line 185 of file reader.hpp.
|
inline |
Create enum attribute reader.
reader | XML reader |
attr_name | name of the attribute |
case_sensitive | true if the attribute value should be case sensitive |
Definition at line 212 of file reader.hpp.
|
inline |
Get attribute.
Definition at line 250 of file reader.hpp.
|
inline |
Get attribute with default value.
default_value | default value of the attribute |
Definition at line 261 of file reader.hpp.
|
inlineprotected |
Definition at line 196 of file reader.hpp.
|
inline |
Require attribute.
Definition at line 242 of file reader.hpp.
|
inline |
Add allowed parameter.
key | text representing the attribute value |
val | value of the attribute |
min | minimum number of letters in the attribute |
Definition at line 221 of file reader.hpp.
|
protected |
Definition at line 190 of file reader.hpp.
|
protected |
Definition at line 191 of file reader.hpp.
|
protected |
Definition at line 194 of file reader.hpp.
|
protected |
Definition at line 189 of file reader.hpp.
|
protected |
Definition at line 193 of file reader.hpp.