]>
Dogcows Code - chaz/yoink/blob - src/stlplus/strings/string_bool.cpp
1 ////////////////////////////////////////////////////////////////////////////////
3 // Author: Andy Rushton
4 // Copyright: (c) Southampton University 1999-2004
5 // (c) Andy Rushton 2004-2009
6 // License: BSD License, see ../docs/license.html
8 // use the unsigned short representation for bool
10 ////////////////////////////////////////////////////////////////////////////////
11 #include "string_bool.hpp"
12 #include "string_int.hpp"
17 ////////////////////////////////////////////////////////////////////////////////
19 std::string
bool_to_string(bool i
, unsigned radix
, radix_display_t display
, unsigned width
)
20 throw(std::invalid_argument
)
22 return unsigned_short_to_string((unsigned short)i
, radix
, display
, width
);
25 ////////////////////////////////////////////////////////////////////////////////
27 bool string_to_bool(const std::string
& str
, unsigned radix
)
28 throw(std::invalid_argument
)
30 return string_to_unsigned_short(str
, radix
) != 0;
33 ////////////////////////////////////////////////////////////////////////////////
35 } // end namespace stlplus
This page took 0.03306 seconds and 4 git commands to generate.