|
a/src/utils/smallut.h |
|
b/src/utils/smallut.h |
|
... |
|
... |
14 |
* Free Software Foundation, Inc.,
|
14 |
* Free Software Foundation, Inc.,
|
15 |
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
15 |
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
16 |
*/
|
16 |
*/
|
17 |
#ifndef _SMALLUT_H_INCLUDED_
|
17 |
#ifndef _SMALLUT_H_INCLUDED_
|
18 |
#define _SMALLUT_H_INCLUDED_
|
18 |
#define _SMALLUT_H_INCLUDED_
|
19 |
/* @(#$Id: smallut.h,v 1.15 2006-01-30 11:15:28 dockes Exp $ (C) 2004 J.F.Dockes */
|
19 |
/* @(#$Id: smallut.h,v 1.16 2006-04-11 06:49:45 dockes Exp $ (C) 2004 J.F.Dockes */
|
20 |
#include <string>
|
20 |
#include <string>
|
21 |
#include <list>
|
21 |
#include <list>
|
22 |
|
22 |
|
23 |
#ifndef NO_NAMESPACES
|
23 |
#ifndef NO_NAMESPACES
|
24 |
using std::string;
|
24 |
using std::string;
|
|
... |
|
... |
57 |
extern void trimstring(string &s, const char *ws = " \t");
|
57 |
extern void trimstring(string &s, const char *ws = " \t");
|
58 |
|
58 |
|
59 |
/** Escape things like < or & by turining them to entities */
|
59 |
/** Escape things like < or & by turining them to entities */
|
60 |
extern string escapeHtml(const string &in);
|
60 |
extern string escapeHtml(const string &in);
|
61 |
|
61 |
|
|
|
62 |
/** Replace some chars with spaces (ie: newline chars). This is not utf8-aware
|
|
|
63 |
* so chars should only contain ascii */
|
|
|
64 |
extern string neutchars(const string &str, string chars);
|
|
|
65 |
|
|
|
66 |
/** Truncate a string to a given maxlength, avoiding cutting off midword
|
|
|
67 |
* if reasonably possible. */
|
|
|
68 |
extern string truncate_to_word(string &input, string::size_type maxlen);
|
62 |
|
69 |
|
63 |
class Chrono {
|
70 |
class Chrono {
|
64 |
public:
|
71 |
public:
|
65 |
Chrono();
|
72 |
Chrono();
|
66 |
/** Reset origin */
|
73 |
/** Reset origin */
|