Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
Inkscape::Util::EnumDataConverter< E > Class Template Reference

Simplified management of enumerations of svg items with UI labels. More...

#include <enums.h>

Public Types

typedef EnumData< E > Data
 

Public Member Functions

 EnumDataConverter (const EnumData< E > *cd, const unsigned int length)
 
get_id_from_label (const Glib::ustring &label) const
 
get_id_from_key (const Glib::ustring &key) const
 
bool is_valid_key (const Glib::ustring &key) const
 
bool is_valid_id (const E id) const
 
const Glib::ustring & get_label (const E id) const
 
const Glib::ustring & get_key (const E id) const
 
const EnumData< E > & data (const unsigned int i) const
 

Public Attributes

const unsigned int _length
 

Private Attributes

const EnumData< E > * _data
 

Detailed Description

template<typename E>
class Inkscape::Util::EnumDataConverter< E >

Simplified management of enumerations of svg items with UI labels.

Note
that get_id_from_key and get_id_from_label return 0 if it cannot find an entry for that key string.
that get_label and get_key return an empty string when the requested id is not in the list.

Definition at line 41 of file enums.h.

Member Typedef Documentation

◆ Data

template<typename E >
typedef EnumData<E> Inkscape::Util::EnumDataConverter< E >::Data

Definition at line 44 of file enums.h.

Constructor & Destructor Documentation

◆ EnumDataConverter()

template<typename E >
Inkscape::Util::EnumDataConverter< E >::EnumDataConverter ( const EnumData< E > *  cd,
const unsigned int  length 
)
inline

Definition at line 46 of file enums.h.

Member Function Documentation

◆ data()

template<typename E >
const EnumData< E > & Inkscape::Util::EnumDataConverter< E >::data ( const unsigned int  i) const
inline

◆ get_id_from_key()

◆ get_id_from_label()

template<typename E >
E Inkscape::Util::EnumDataConverter< E >::get_id_from_label ( const Glib::ustring &  label) const
inline

◆ get_key()

template<typename E >
const Glib::ustring & Inkscape::Util::EnumDataConverter< E >::get_key ( const E  id) const
inline

◆ get_label()

◆ is_valid_id()

template<typename E >
bool Inkscape::Util::EnumDataConverter< E >::is_valid_id ( const E  id) const
inline

◆ is_valid_key()

template<typename E >
bool Inkscape::Util::EnumDataConverter< E >::is_valid_key ( const Glib::ustring &  key) const
inline

Member Data Documentation

◆ _data

◆ _length


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