added missing mapnik::value to std::wstring conversions

This commit is contained in:
Artem Pavlenko 2007-02-14 20:25:24 +00:00
parent 2d256166b4
commit eda5386b3f

View file

@ -347,15 +347,16 @@ namespace mapnik {
for (;pos!=val.end();++pos) for (;pos!=val.end();++pos)
{ {
wchar_t c = *pos; wchar_t c = *pos;
if (c < 0x7f) if (c < 0x80)
{ {
ss << char(c); ss << char(c);
} }
else else
{ {
ss << "\\x"; ss << "\\x";
ss << ((c >> 8) & 0xff); unsigned c0 = (c >> 8) & 0xff;
ss << (c & 0xff); if (c0) ss << c0;
ss << (c & 0xff);
} }
} }
return ss.str(); return ss.str();
@ -375,7 +376,9 @@ namespace mapnik {
template <typename T> template <typename T>
std::wstring operator() (T val) const std::wstring operator() (T val) const
{ {
return L"TODO"; std::basic_ostringstream<wchar_t> out;
out << val;
return out.str();
} }
// specializations // specializations
std::wstring const& operator() (std::wstring const& val) const std::wstring const& operator() (std::wstring const& val) const
@ -394,18 +397,19 @@ namespace mapnik {
for (;pos!=val.end();++pos) for (;pos!=val.end();++pos)
{ {
wchar_t c = *pos; wchar_t c = *pos;
if (c < 0x7f) if (c < 0x80)
{ {
ss << char(c); ss << char(c);
} }
else else
{ {
ss << "\\x"; ss << "\\x";
ss << ((c >> 8) & 0xff); unsigned c0 = (c >> 8) & 0xff;
ss << (c & 0xff); if (c0) ss << c0;
ss << (c & 0xff);
} }
} }
return ss.str(); return "\'" + ss.str() + "\'";
} }
template <typename T> template <typename T>