Switch to unified view

a/src/utils/smallut.h b/src/utils/smallut.h
...
...
45
    const string& m_s1;
45
    const string& m_s1;
46
};
46
};
47
47
48
extern int stringlowercmp(const string& alreadylower, const string& s2);
48
extern int stringlowercmp(const string& alreadylower, const string& s2);
49
extern int stringuppercmp(const string& alreadyupper, const string& s2); 
49
extern int stringuppercmp(const string& alreadyupper, const string& s2); 
50
50
extern void stringtolower(string& io);
51
extern void stringtolower(string& io);
51
extern string stringtolower(const string& io);
52
extern string stringtolower(const string& io);
53
52
// Is one string the end part of the other ?
54
// Is one string the end part of the other ?
53
extern int stringisuffcmp(const string& s1, const string& s2);
55
extern int stringisuffcmp(const string& s1, const string& s2);
54
56
55
// Compare charset names, removing the more common spelling variations
57
// Compare charset names, removing the more common spelling variations
56
extern bool samecharset(const string &cs1, const string &cs2);
58
extern bool samecharset(const string &cs1, const string &cs2);
...
...
67
// YYYY/ (from YYYY) YYYY-MM-DD/P3Y (3 years after date) etc.
69
// YYYY/ (from YYYY) YYYY-MM-DD/P3Y (3 years after date) etc.
68
// This returns a pair of y,m,d dates.
70
// This returns a pair of y,m,d dates.
69
struct DateInterval {
71
struct DateInterval {
70
    int y1;int m1;int d1; int y2;int m2;int d2;
72
    int y1;int m1;int d1; int y2;int m2;int d2;
71
};
73
};
72
bool parsedateinterval(const string&s, DateInterval *di);
74
extern bool parsedateinterval(const string&s, DateInterval *di);
73
int monthdays(int mon, int year);
75
extern int monthdays(int mon, int year);
74
76
75
/**
77
/**
76
 * Parse input string into list of strings. 
78
 * Parse input string into list of strings. 
77
 *
79
 *
78
 * Token delimiter is " \t\n" except inside dquotes. dquote inside
80
 * Token delimiter is " \t\n" except inside dquotes. dquote inside
...
...
80
 * Input is handled a byte at a time, things will work as long as space tab etc.
82
 * Input is handled a byte at a time, things will work as long as space tab etc.
81
 * have the ascii values and can't appear as part of a multibyte char. utf-8 ok
83
 * have the ascii values and can't appear as part of a multibyte char. utf-8 ok
82
 * but so are the iso-8859-x and surely others. addseps do have to be 
84
 * but so are the iso-8859-x and surely others. addseps do have to be 
83
 * single-bytes
85
 * single-bytes
84
 */
86
 */
85
extern bool stringToStrings(const string& s, list<string> &tokens, 
86
                            const string& addseps = "");
87
extern bool stringToStrings(const string& s, vector<string> &tokens, 
88
                            const string& addseps = "");
89
extern bool stringToStrings(const string& s, set<string> &tokens, 
87
template <class T> bool stringToStrings(const string& s, T &tokens, 
90
                            const string& addseps = "");
88
                  const string& addseps = "");
91
89
92
/**
90
/**
93
 * Inverse operation:
91
 * Inverse operation:
94
 */
92
 */
95
extern void stringsToString(const list<string> &tokens, string &s);
96
extern void stringsToString(const vector<string> &tokens, string &s);
97
extern void stringsToString(const set<string> &tokens, string &s);
93
template <class T> void stringsToString(const T &tokens, string &s);
98
94
99
/**
95
/**
100
 * Split input string. No handling of quoting
96
 * Split input string. No handling of quoting
101
 */
97
 */
102
extern void stringToTokens(const string &s, vector<string> &tokens, 
98
extern void stringToTokens(const string &s, vector<string> &tokens,