| 35 |
#include <stdlib.h> // for NULL |
#include <stdlib.h> // for NULL |
| 36 |
#include <string> |
#include <string> |
| 37 |
|
|
| 38 |
|
#include <pcre.h> |
| 39 |
|
|
| 40 |
namespace pcrecpp { |
namespace pcrecpp { |
| 41 |
|
|
| 42 |
class StringPiece; |
class StringPiece; |
| 48 |
class _RE_MatchObject { |
class _RE_MatchObject { |
| 49 |
public: |
public: |
| 50 |
static inline bool Parse(const char* str, int n, void* dest) { |
static inline bool Parse(const char* str, int n, void* dest) { |
| 51 |
|
if (dest == NULL) return true; |
| 52 |
T* object = reinterpret_cast<T*>(dest); |
T* object = reinterpret_cast<T*>(dest); |
| 53 |
return object->ParseFrom(str, n); |
return object->ParseFrom(str, n); |
| 54 |
} |
} |
| 55 |
}; |
}; |
| 56 |
|
|
| 57 |
class Arg { |
class PCRECPP_EXP_DEFN Arg { |
| 58 |
public: |
public: |
| 59 |
// Empty constructor so we can declare arrays of Arg |
// Empty constructor so we can declare arrays of Arg |
| 60 |
Arg(); |
Arg(); |
| 151 |
inline Arg CRadix(type* ptr) { \ |
inline Arg CRadix(type* ptr) { \ |
| 152 |
return Arg(ptr, Arg::parse_ ## name ## _cradix); } |
return Arg(ptr, Arg::parse_ ## name ## _cradix); } |
| 153 |
|
|
| 154 |
MAKE_INTEGER_PARSER(short, short); |
MAKE_INTEGER_PARSER(short, short) /* */ |
| 155 |
MAKE_INTEGER_PARSER(unsigned short, ushort); |
MAKE_INTEGER_PARSER(unsigned short, ushort) /* */ |
| 156 |
MAKE_INTEGER_PARSER(int, int); |
MAKE_INTEGER_PARSER(int, int) /* Don't use semicolons */ |
| 157 |
MAKE_INTEGER_PARSER(unsigned int, uint); |
MAKE_INTEGER_PARSER(unsigned int, uint) /* after these statement */ |
| 158 |
MAKE_INTEGER_PARSER(long, long); |
MAKE_INTEGER_PARSER(long, long) /* because they can cause */ |
| 159 |
MAKE_INTEGER_PARSER(unsigned long, ulong); |
MAKE_INTEGER_PARSER(unsigned long, ulong) /* compiler warnings if */ |
| 160 |
#if @pcre_have_long_long@ |
#if @pcre_have_long_long@ /* the checking level is */ |
| 161 |
MAKE_INTEGER_PARSER(long long, longlong); |
MAKE_INTEGER_PARSER(long long, longlong) /* turned up high enough. */ |
| 162 |
#endif |
#endif /* */ |
| 163 |
#if @pcre_have_ulong_long@ |
#if @pcre_have_ulong_long@ /* */ |
| 164 |
MAKE_INTEGER_PARSER(unsigned long long, ulonglong); |
MAKE_INTEGER_PARSER(unsigned long long, ulonglong) /* */ |
| 165 |
#endif |
#endif |
| 166 |
|
|
| 167 |
#undef PCRE_IS_SET |
#undef PCRE_IS_SET |