#include "boost/tuple/tuple.hpp"
+// This is ugly: one should be using twoargument isspace since whitspace can
+// be locale dependent, in theory at least.
+// not all libraries implement have the two-arg version, so we need to
+// use the one-arg one, which one should get with <cctype> but there seem
+// to be exceptions to this.
+
+#if !defined (BOOST_NO_STD_LOCALE)
+
+#include <locale> // for two-arg isspace
+
+#else
+
+#include <cctype> // for one-arg (old) isspace
+#include <ctype.h> // Metrowerks does not find one-arg isspace from cctype
+
+#endif
+
namespace boost {
namespace tuples {
// parentheses and space are the default manipulators
if (!c) {
switch(m) {
- case open : c = '('; break;
- case close : c = ')'; break;
- case delimiter : c = ' '; break;
+ case detail::format_info::open : c = '('; break;
+ case detail::format_info::close : c = ')'; break;
+ case detail::format_info::delimiter : c = ' '; break;
}
}
return c;
// parentheses and space are the default manipulators
if (!c) {
switch(m) {
- case open : c = i.widen('('); break;
- case close : c = i.widen(')'); break;
- case delimiter : c = i.widen(' '); break;
+ case detail::format_info::open : c = i.widen('('); break;
+ case detail::format_info::close : c = i.widen(')'); break;
+ case detail::format_info::delimiter : c = i.widen(' '); break;
}
}
return c;
{
const char d = format_info::get_manipulator(is, del);
- const bool is_delimiter = (!isspace(d) );
+#if defined (BOOST_NO_STD_LOCALE)
+ const bool is_delimiter = !isspace(d);
+#else
+ const bool is_delimiter = (!std::isspace(d, is.getloc()) );
+#endif
char c;
if (is_delimiter) {
{
const CharType d = format_info::get_manipulator(is, del);
- const bool is_delimiter = (!isspace(d) );
+#if defined (BOOST_NO_STD_LOCALE)
+ const bool is_delimiter = !isspace(d);
+#elif defined ( __BORLANDC__ )
+ const bool is_delimiter = !std::use_facet< std::ctype< CharType > >
+ (is.getloc() ).is( std::ctype_base::space, d);
+#else
+ const bool is_delimiter = (!std::isspace(d, is.getloc()) );
+#endif
CharType c;
if (is_delimiter) {