Upgrade gettext infrastructure.
7 //std::cout << __PRETTY_FUNCTION__ << std::endl;
11 MapValue::MapValue(double d)
13 //std::cout << __PRETTY_FUNCTION__ << std::endl;
14 p_value = new double(d);
19 MapValue::MapValue(std::string str)
21 //std::cout << __PRETTY_FUNCTION__ << std::endl;
22 p_value = new std::string(str);
27 MapValue::MapValue(const char* str)
29 //std::cout << __PRETTY_FUNCTION__ << std::endl;
30 p_value = new std::string(str);
35 MapValue::operator double() const
37 //std::cout << __PRETTY_FUNCTION__ << std::endl;
38 if (!has_value) throw IllegalOperation();
40 return *(static_cast<double*>(p_value));
42 throw IllegalOperation();
45 MapValue::operator std::string() const
47 //std::cout << __PRETTY_FUNCTION__ << std::endl;
48 if (!has_value) throw IllegalOperation();
54 double d = *(static_cast<double*>(p_value));
55 std::ostringstream ostr;
61 ret = *(static_cast<std::string*>(p_value));
67 MapValue::MapValue(const MapValue& v)
69 //std::cout << __PRETTY_FUNCTION__ << std::endl;
70 if (!v.has_value) throw IllegalOperation();
76 p_value = new double(*(static_cast<double*>(v.p_value)));
79 p_value = new std::string(*(static_cast<std::string*>(v.p_value)));
84 MapValue& MapValue::operator=(const MapValue& v)
86 //std::cout << __PRETTY_FUNCTION__ << std::endl;
89 if (!v.has_value) throw IllegalOperation();
96 p_value = new double(*(static_cast<double*>(v.p_value)));
99 p_value = new std::string(*(static_cast<std::string*>(v.p_value)));
106 MapValue::~MapValue()
108 //std::cout << __PRETTY_FUNCTION__ << std::endl;
112 void MapValue::clear()
114 //std::cout << __PRETTY_FUNCTION__ << std::endl;
115 if (!has_value) return;
119 delete static_cast<double*>(p_value);
122 delete static_cast<std::string*>(p_value);
127 MapValue::Type MapValue::getType() const
129 //std::cout << __PRETTY_FUNCTION__ << std::endl;
133 bool MapValue::hasValue() const
135 //std::cout << __PRETTY_FUNCTION__ << std::endl;
139 std::ostream& operator<<(std::ostream &os, const MapValue& v)
141 //std::cout << __PRETTY_FUNCTION__ << std::endl;
142 if (!v.has_value) return os;
145 case MapValue::NUMERIC:
146 os << *(static_cast<double*>(v.p_value));
148 case MapValue::STRING:
149 os << *(static_cast<std::string*>(v.p_value));