|
a/src/utils/conftree.cpp |
|
b/src/utils/conftree.cpp |
1 |
#ifndef lint
|
1 |
#ifndef lint
|
2 |
static char rcsid [] = "@(#$Id: conftree.cpp,v 1.3 2005-11-25 08:50:39 dockes Exp $ (C) 2003 J.F.Dockes";
|
2 |
static char rcsid [] = "@(#$Id: conftree.cpp,v 1.4 2005-11-25 14:36:45 dockes Exp $ (C) 2003 J.F.Dockes";
|
3 |
#endif
|
3 |
#endif
|
4 |
#ifdef HAVE_CONFIG_H
|
4 |
#ifdef HAVE_CONFIG_H
|
5 |
#include "config.h"
|
5 |
#include "config.h"
|
6 |
#endif
|
6 |
#endif
|
7 |
|
7 |
|
|
... |
|
... |
13 |
#include <fstream>
|
13 |
#include <fstream>
|
14 |
#include <sstream>
|
14 |
#include <sstream>
|
15 |
|
15 |
|
16 |
#include "conftree.h"
|
16 |
#include "conftree.h"
|
17 |
#include "pathut.h"
|
17 |
#include "pathut.h"
|
|
|
18 |
#include "smallut.h"
|
18 |
|
19 |
|
19 |
#ifndef NO_NAMESPACES
|
20 |
#ifndef NO_NAMESPACES
|
20 |
using namespace std;
|
21 |
using namespace std;
|
21 |
using std::list;
|
22 |
using std::list;
|
22 |
#endif // NO_NAMESPACES
|
23 |
#endif // NO_NAMESPACES
|
23 |
|
24 |
|
24 |
#ifndef MIN
|
25 |
#ifndef MIN
|
25 |
#define MIN(A,B) ((A)<(B) ? (A) : (B))
|
26 |
#define MIN(A,B) ((A)<(B) ? (A) : (B))
|
26 |
#endif
|
27 |
#endif
|
27 |
|
28 |
|
28 |
/** Remove instances of characters belonging to set (default {space,
|
|
|
29 |
tab}) at beginning and end of input string */
|
|
|
30 |
static void trimstring(string &s, const char *ws = " \t")
|
|
|
31 |
{
|
|
|
32 |
string::size_type pos = s.find_first_not_of(ws);
|
|
|
33 |
if (pos == string::npos) {
|
|
|
34 |
s = "";
|
|
|
35 |
return;
|
|
|
36 |
}
|
|
|
37 |
s.replace(0, pos, "");
|
|
|
38 |
|
|
|
39 |
pos = s.find_last_not_of(ws);
|
|
|
40 |
if (pos != string::npos && pos != s.length()-1)
|
|
|
41 |
s.replace(pos+1, string::npos, "");
|
|
|
42 |
}
|
|
|
43 |
|
29 |
|
44 |
#define LL 1024
|
30 |
#define LL 1024
|
45 |
void ConfSimple::parseinput(istream &input)
|
31 |
void ConfSimple::parseinput(istream &input)
|
46 |
{
|
32 |
{
|
47 |
string submapkey;
|
33 |
string submapkey;
|