00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifdef __cplusplus
00024
00025 # ifndef OGS_CORE_DETAILS_GENDER_H
00026 # define OGS_CORE_DETAILS_GENDER_H
00027
00028 # include <string>
00029
00030 # include <ogs/core/Detail.h>
00031 # include <ogs/core/details/Namespace.h>
00032
00033 OGS_BEGIN_CORE_DETAILS_NAMESPACE
00034
00040 class Gender: public Detail {
00041 public:
00045 enum Value {
00047 UNKNOWN = 0,
00049 MALE = 'M',
00051 FEMALE = 'F',
00053 ASEXUAL = 'A',
00055 BISEXUAL = 'B'
00056 };
00057
00058 Gender (Value value = UNKNOWN);
00059
00060 Value getValue () const;
00061
00062 std::string getName () const;
00063 std::string toString () const;
00064
00065 private:
00066 Value _value;
00067
00068 static bool isValid (int i);
00069 };
00070
00076 inline Gender::Value
00077 Gender::getValue () const {
00078 return (this->_value);
00079 }
00080
00087 inline bool
00088 Gender::isValid (int i) {
00089 return (i == UNKNOWN || i == MALE || i == FEMALE ||
00090 i == ASEXUAL || i == BISEXUAL);
00091 }
00092
00093 OGS_END_CORE_DETAILS_NAMESPACE
00094
00095 # endif
00096
00097 #endif
00098