|
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.27 2007-05-21 12:03:52 dockes Exp $ (C) 2004 J.F.Dockes */
|
19 |
/* @(#$Id: smallut.h,v 1.28 2008-05-08 09:57:29 dockes Exp $ (C) 2004 J.F.Dockes */
|
20 |
#include <string>
|
20 |
#include <string>
|
21 |
#include <list>
|
21 |
#include <list>
|
|
|
22 |
#include <vector>
|
22 |
#include <map>
|
23 |
#include <map>
|
23 |
|
24 |
|
24 |
#ifndef NO_NAMESPACES
|
25 |
#ifndef NO_NAMESPACES
|
25 |
using std::string;
|
26 |
using std::string;
|
26 |
using std::list;
|
27 |
using std::list;
|
|
|
28 |
using std::vector;
|
27 |
using std::map;
|
29 |
using std::map;
|
28 |
#endif /* NO_NAMESPACES */
|
30 |
#endif /* NO_NAMESPACES */
|
29 |
|
31 |
|
30 |
// Note these are all ascii routines
|
32 |
// Note these are all ascii routines
|
31 |
extern int stringicmp(const string& s1, const string& s2);
|
33 |
extern int stringicmp(const string& s1, const string& s2);
|
|
... |
|
... |
43 |
*
|
45 |
*
|
44 |
* Token delimiter is " \t\n" except inside dquotes. dquote inside
|
46 |
* Token delimiter is " \t\n" except inside dquotes. dquote inside
|
45 |
* dquotes can be escaped with \ etc...
|
47 |
* dquotes can be escaped with \ etc...
|
46 |
*/
|
48 |
*/
|
47 |
extern bool stringToStrings(const string &s, list<string> &tokens);
|
49 |
extern bool stringToStrings(const string &s, list<string> &tokens);
|
|
|
50 |
extern bool stringToStrings(const string &s, vector<string> &tokens);
|
|
|
51 |
|
48 |
/**
|
52 |
/**
|
49 |
* Inverse operation:
|
53 |
* Inverse operation:
|
50 |
*/
|
54 |
*/
|
51 |
extern void stringsToString(const list<string> &tokens, string &s);
|
55 |
extern void stringsToString(const list<string> &tokens, string &s);
|
|
|
56 |
extern void stringsToString(const vector<string> &tokens, string &s);
|
52 |
|
57 |
|
53 |
/**
|
58 |
/**
|
54 |
* Split input string. No handling of quoting
|
59 |
* Split input string. No handling of quoting
|
55 |
*/
|
60 |
*/
|
56 |
extern void stringToTokens(const string &s, list<string> &tokens,
|
61 |
extern void stringToTokens(const string &s, list<string> &tokens,
|