00001 #ifndef LUX_FIELD_H 00002 #define LUX_FIELD_H 00003 00004 #include <string> 00005 00006 namespace Lux { 00007 00011 class Field { 00012 00013 public: 00017 ~Field(void) {} 00024 static Field *create(const std::string &name, const std::string &value) 00025 { 00026 Field *field = new Field(name, value); 00027 return field; 00028 } 00035 static Field *create(const char *name, const char *value) 00036 { 00037 std::string n(name); 00038 std::string v(value); 00039 return Field::create(n, v); 00040 } 00044 std::string get_name(void) { return name_; }; 00048 std::string get_name(void) const { return name_; }; 00052 std::string get_value(void) { return value_; }; 00056 std::string get_value(void) const { return value_; }; 00057 00058 private: 00059 std::string name_; 00060 std::string value_; 00061 00062 Field(const std::string &name, const std::string &value) 00063 : name_(name), value_(value) 00064 {} 00065 }; 00066 } 00067 00068 #endif