Base template class for enum properties. Note: Index values of enum type must start from 0 and increase sequentially.
Definition at line 745 of file fbproperties.h.
#include <fbproperties.h>
Public Member Functions | |
FBPropertyBaseEnum () | |
Constructor. | |
~FBPropertyBaseEnum () | |
Destructor. | |
FBPropertyBaseEnum (const FBPropertyBaseEnum< tType > &pValue) | |
FBPropertyBaseEnum. | |
operator tType () const | |
Overloaded cast to tType operator. | |
virtual const char * | EnumList (int pIndex) override |
Return the string of an enum value. | |
virtual const char * | AsString (FBDataAsStringFlag pFlag=kFBDataAsStringUI) override |
Get as string. | |
virtual bool | SetString (const char *pString) override |
Set enum value by equivalent string. | |
void | operator= (tType pValue) |
Overloaded = operator. | |
Static Public Attributes | |
static const char * | mStrings [] |
String list. |
FBPropertyBaseEnum | ( | ) | [inline] |
~FBPropertyBaseEnum | ( | ) | [inline] |
FBPropertyBaseEnum | ( | const FBPropertyBaseEnum< tType > & | pValue | ) | [inline] |
pValue | FBPropertyBaseEnum. |
Definition at line 764 of file fbproperties.h.
{ operator=((tType)pValue ); }
void operator= | ( | tType | pValue | ) | [inline] |
Overloaded = operator.
Set the value of the current object using Set function.
pValue | Value to set for object. |
Reimplemented from FBPropertyBase< tType, kFBPT_enum >.
Definition at line 771 of file fbproperties.h.
{ SetData( &pValue ); }
operator tType | ( | ) | const [inline] |
Overloaded cast to tType operator.
Get the value of the current object using Get function.
Reimplemented from FBPropertyBase< tType, kFBPT_enum >.
Definition at line 778 of file fbproperties.h.
{ tType Value; GetData( &Value,sizeof(Value) ); return Value; }
virtual const char* EnumList | ( | int | pIndex | ) | [inline, override, virtual] |
Return the string of an enum value.
pIndex | Enum value to get string for. |
pIndex
. Reimplemented from FBProperty.
Definition at line 780 of file fbproperties.h.
{ if( FBPropertyBaseEnum::IsInternal() ) { return FBProperty::EnumList( pIndex ); } else if(mStrings) { return mStrings[pIndex]; } else { assert(mStrings || FBPropertyBaseEnum::IsInternal()); return NULL; } }
virtual const char* AsString | ( | FBDataAsStringFlag | pFlag = kFBDataAsStringUI | ) | [inline, override, virtual] |
Get as string.
pFlag | Specifies the purpose of returned string it defaults to kFBDataAsStringUI. |
Reimplemented from FBProperty.
Definition at line 801 of file fbproperties.h.
{ return EnumList( FBPropertyBaseEnum::AsInt() );}
virtual bool SetString | ( | const char * | pString | ) | [inline, override, virtual] |
Set enum value by equivalent string.
pString | String to set for enum property, with format same as AsString(kFBDataAsStringPersistence) |
Reimplemented from FBProperty.
Definition at line 807 of file fbproperties.h.
{ int Count=0; const char * tmpstr; while ((tmpstr=EnumList( Count ))!=NULL) { if (strcmp(tmpstr,pString)==0) { FBPropertyBaseEnum::SetData( &Count ); return true; } Count++; } return false; }
const char* mStrings[] [static] |