1 /***************************************************************************
3 * Copyright (C) 2006 David Brodsky *
5 * This library is free software; you can redistribute it and/or *
6 * modify it under the terms of the GNU Library General Public *
7 * License as published by the Free Software Foundation and appearing *
8 * in the file LICENSE.LGPL included in the packaging of this file. *
10 * This library is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
13 * Library General Public License for more details. *
15 ***************************************************************************/
28 /* {{{ String::lstrip() */
29 String
&String::lstrip()
32 while (isspace((*this)[pos
]) && (pos
< length()))
40 /* {{{ String::number(double) */
41 String
String::number(double num
)
43 std::stringstream str
;
49 /* {{{ String::number(int32_t) */
50 String
String::number(int32_t num
)
52 std::stringstream str
;
58 /* {{{ String::number(uint32_t) */
59 String
String::number(uint32_t num
)
61 std::stringstream str
;
67 /* {{{ String::number(int64_t) */
68 String
String::number(int64_t num
)
70 std::stringstream str
;
76 /* {{{ String::number(uint64_t) */
77 String
String::number(uint64_t num
)
79 std::stringstream str
;
85 /* {{{ String::readLine() */
86 String
String::readLine()
88 size_t n
= find('\n');
92 String ret
= substr(0, n
);
93 if (ret
.length() && (ret
[ret
.length() - 1] == '\r'))
94 ret
.resize(ret
.length() - 1);
100 /* {{{ String::rstrip() */
101 String
&String::rstrip()
103 size_t pos
= length() - 1;
104 while (isspace((*this)[pos
]) && (pos
!= npos
))
112 /* {{{ String::strip() */
113 String
&String::strip()
115 return lstrip().rstrip();
121 }; // namespace Tairon
123 // vim: ai sw=4 ts=4 noet fdm=marker