Ticket #6439: boost_po_compile_w_NO_STD_LOCALE_v2.patch
File boost_po_compile_w_NO_STD_LOCALE_v2.patch, 2.6 KB (added by , 11 years ago) |
---|
-
boost/program_options/detail/convert.hpp
8 8 9 9 #include <boost/program_options/config.hpp> 10 10 11 #if !defined(BOOST_NO_STD_WSTRING) 11 #if !defined(BOOST_NO_STD_WSTRING) && !defined(BOOST_NO_STD_LOCALE) 12 12 13 13 #include <boost/detail/workaround.hpp> 14 14 … … 90 90 #include <vector> 91 91 #include <string> 92 92 namespace boost{ 93 94 #ifndef BOOST_NO_STD_WSTRING 95 BOOST_PROGRAM_OPTIONS_DECL std::string 96 to_utf8(const std::wstring& s); 97 98 BOOST_PROGRAM_OPTIONS_DECL std::wstring 99 from_utf8(const std::string& s); 100 101 BOOST_PROGRAM_OPTIONS_DECL std::string 102 to_local_8_bit(const std::wstring& s); 103 104 BOOST_PROGRAM_OPTIONS_DECL std::wstring 105 from_local_8_bit(const std::string& s); 106 #endif 107 93 108 namespace program_options{ 94 109 BOOST_PROGRAM_OPTIONS_DECL std::string to_internal(const std::string&); 110 #ifndef BOOST_NO_STD_WSTRING 111 BOOST_PROGRAM_OPTIONS_DECL std::string to_internal(const std::wstring& s); 112 #endif 95 113 96 114 template<class T> 97 115 std::vector<std::string> to_internal(const std::vector<T>& s) -
libs/program_options/src/convert.cpp
84 84 85 85 namespace boost { 86 86 87 #if ndef BOOST_NO_STD_WSTRING87 #if !defined(BOOST_NO_STD_WSTRING) && !defined(BOOST_NO_STD_LOCALE) 88 88 BOOST_PROGRAM_OPTIONS_DECL std::wstring 89 89 from_8_bit(const std::string& s, 90 90 const std::codecvt<wchar_t, char, std::mbstate_t>& cvt) … … 142 142 } 143 143 #endif 144 144 145 #ifdef BOOST_NO_STD_LOCALE 146 // these methods are NOT converting character sets! 147 BOOST_PROGRAM_OPTIONS_DECL std::string 148 to_utf8(const std::wstring& s) 149 { 150 return std::string(s.begin(), s.end()); 151 } 152 153 BOOST_PROGRAM_OPTIONS_DECL std::wstring 154 from_utf8(const std::string& s) 155 { 156 return std::wstring(s.begin(), s.end()); 157 } 158 159 BOOST_PROGRAM_OPTIONS_DECL std::string 160 to_local_8_bit(const std::wstring& s) 161 { 162 return std::string(s.begin(), s.end()); 163 } 164 165 BOOST_PROGRAM_OPTIONS_DECL std::wstring 166 from_local_8_bit(const std::string& s) 167 { 168 return std::wstring(s.begin(), s.end()); 169 } 170 #endif 171 145 172 namespace program_options 146 173 { 147 174 BOOST_PROGRAM_OPTIONS_DECL std::string to_internal(const std::string& s)