]> Dogcows Code - chaz/yoink/blob - src/stlplus/strings/string_bool.cpp
cleanup stlplus files
[chaz/yoink] / src / stlplus / strings / string_bool.cpp
1 ////////////////////////////////////////////////////////////////////////////////
2
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
7
8 // use the unsigned short representation for bool
9
10 ////////////////////////////////////////////////////////////////////////////////
11 #include "string_bool.hpp"
12 #include "string_int.hpp"
13
14 namespace stlplus
15 {
16
17 ////////////////////////////////////////////////////////////////////////////////
18
19 std::string bool_to_string(bool i, unsigned radix, radix_display_t display, unsigned width)
20 throw(std::invalid_argument)
21 {
22 return unsigned_short_to_string((unsigned short)i, radix, display, width);
23 }
24
25 ////////////////////////////////////////////////////////////////////////////////
26
27 bool string_to_bool(const std::string& str, unsigned radix)
28 throw(std::invalid_argument)
29 {
30 return string_to_unsigned_short(str, radix) != 0;
31 }
32
33 ////////////////////////////////////////////////////////////////////////////////
34
35 } // end namespace stlplus
This page took 0.031769 seconds and 4 git commands to generate.