summaryrefslogtreecommitdiff
path: root/xmlspec/XMLMisc.h
blob: d47fa57b6089d92501834656a6b34374d2a458cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#ifndef _H_XMLMISC_
#define _H_XMLMISC_

extern char* g_szaDays[];
extern char* g_szaMonths[];

/**
 * Splits the input string according to the terminator, returning
 * the length and the new search position
 * .
 * @param szInput The input string
 * @param cTerm The terminating character
 * @param nLen the length buffer
 * @return The next string position
 **/
extern char* splitStr(const char* szInput,
					  char cTerm,
					  int& nLen);

/**
 * Finds a string in an array of potential matches
 * .
 * @param szaMatches The potential matches
 * @param szValue The value to search for
 * @return The position on success, -1 if not found
 **/
extern int findStr(char* szaMatches[],
				   const char* szValue,
				   int nLen = -1);

/**
 * Checks if a string contains an integer
 * .
 * @param szValue The string to check
 * @param nLen The length to check, -1 to end of string
 * @return true if the string is an integer, false otherwise
 **/
extern bool isInteger(const char* szValue,
					  int nLen = -1);

/**
 * Checks if a string contains a boolean value
 * .
 * @param szValue The value to check
 * @return true if we have a boolean, false otherwise
 **/
extern bool isBool(const char* szValue,
				   int nLen = -1);

/**
 * Checks if a string is in a valid date format
 * .
 * @param szValue The string to check
 * @return true is this is a date, false otherwise
 **/
extern bool isDate(const char* szValue);

/**
 * Checks if a string contains a valid e-mail address
 * .
 * @param szValue the string to check
 * @return true if this is an email address, false otherwise
 **/
extern bool isEmail(const char* szValue);

#endif