⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⢠⣴⣿⣿⣿⣷⣼⣿⠀⣴⠾⠷⠶⠦⡄⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⢠⡤⢶⣦⣾⣿⣿⣿⣿⣿⣿⣿⠀⣿⣶⣶⣦⣄⠳⣤⣤⠄⠀⠀⠀
⠀⠀⠀⢀⣼⣳⡿⢻⣿⣿⣿⣿⣿⣿⣿⣿⣶⣿⣿⣗⠈⠙⠻⣶⣄⡀⠀⠀⠀
⠀⠀⠀⣰⠿⠁⢀⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⡄⠀⠀⠈⠳⣤⠀⠀
⠀⠀⢀⡟⠀⢰⣿⠟⠻⢿⣿⣿⣿⣿⣿⣿⣿⣿⠉⠁⠈⠻⣶⣄⠀⠀⠈⠛⢦   
⠀⣀⡼⠃⠀⣼⡟⠀⠀⢸⣿⡿⠉⣿⡿⠿⠛⣿⡄⠀⠀⠀⠙⠿⣆⠀⠀⠀⠈
⠈⠁⠀⠀⢸⡟⠀⠀⠀⢸⣿⠀⠀⣿⠁⠀⠀⠈⠃⠀⠀⠀⠀⠀⠘⢷⡄⠀⠀
⠀⠀⠀⠀⣼⠃⠀⠀⠀⢸⡟⠀⠀⡿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⢿⡆⠀
⠀⠀⠀⣠⡏⠀⠀⠀⠀⣼⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠻⠃⠀⠀⠀⠀⣻⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ 
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠻⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀

Current Dir: /usr/include/

[DIR] GL [ delete | rename ]
[DIR] KF5 [ delete | rename ]
[DIR] X11 [ delete | rename ]
[DIR] apache2 [ delete | rename ]
[DIR] arpa [ delete | rename ]
[DIR] asm [ delete | rename ]
[DIR] asm-generic [ delete | rename ]
[DIR] bind9 [ delete | rename ]
[DIR] bits [ delete | rename ]
[DIR] bsock [ delete | rename ]
[DIR] c++ [ delete | rename ]
[DIR] criu [ delete | rename ]
[DIR] db4.7.25 [ delete | rename ]
[DIR] drm [ delete | rename ]
[DIR] e2p [ delete | rename ]
[DIR] et [ delete | rename ]
[DIR] ext2fs [ delete | rename ]
[DIR] fontconfig [ delete | rename ]
[DIR] freetype2 [ delete | rename ]
[DIR] gdbm [ delete | rename ]
[DIR] gnu [ delete | rename ]
[DIR] google [ delete | rename ]
[DIR] gssapi [ delete | rename ]
[DIR] gssrpc [ delete | rename ]
[DIR] kadm5 [ delete | rename ]
[DIR] kde4 [ delete | rename ]
[DIR] krb5 [ delete | rename ]
[DIR] libdb [ delete | rename ]
[DIR] libexslt [ delete | rename ]
[DIR] libltdl [ delete | rename ]
[DIR] libpng15 [ delete | rename ]
[DIR] libxml2 [ delete | rename ]
[DIR] libxslt [ delete | rename ]
[DIR] linux [ delete | rename ]
[DIR] lzma [ delete | rename ]
[DIR] misc [ delete | rename ]
[DIR] mtd [ delete | rename ]
[DIR] mysql [ delete | rename ]
[DIR] ncurses [ delete | rename ]
[DIR] ncursesw [ delete | rename ]
[DIR] net [ delete | rename ]
[DIR] netash [ delete | rename ]
[DIR] netatalk [ delete | rename ]
[DIR] netax25 [ delete | rename ]
[DIR] neteconet [ delete | rename ]
[DIR] netinet [ delete | rename ]
[DIR] netipx [ delete | rename ]
[DIR] netiucv [ delete | rename ]
[DIR] netpacket [ delete | rename ]
[DIR] netrom [ delete | rename ]
[DIR] netrose [ delete | rename ]
[DIR] nfs [ delete | rename ]
[DIR] openssl [ delete | rename ]
[DIR] protobuf-c [ delete | rename ]
[DIR] protocols [ delete | rename ]
[DIR] python2.7 [ delete | rename ]
[DIR] python3.6m [ delete | rename ]
[DIR] quota [ delete | rename ]
[DIR] rdma [ delete | rename ]
[DIR] rpc [ delete | rename ]
[DIR] rpcsvc [ delete | rename ]
[DIR] sasl [ delete | rename ]
[DIR] scsi [ delete | rename ]
[DIR] security [ delete | rename ]
[DIR] selinux [ delete | rename ]
[DIR] sepol [ delete | rename ]
[DIR] sound [ delete | rename ]
[DIR] sys [ delete | rename ]
[DIR] uapi [ delete | rename ]
[DIR] uuid [ delete | rename ]
[DIR] video [ delete | rename ]
[DIR] xcb [ delete | rename ]
[DIR] xen [ delete | rename ]
[FILE] FlexLexer.h [ edit | delete | rename | download ]
[FILE] _G_config.h [ edit | delete | rename | download ]
[FILE] a.out.h [ edit | delete | rename | download ]
[FILE] aio.h [ edit | delete | rename | download ]
[FILE] aliases.h [ edit | delete | rename | download ]
[FILE] alloca.h [ edit | delete | rename | download ]
[FILE] ar.h [ edit | delete | rename | download ]
[FILE] argp.h [ edit | delete | rename | download ]
[FILE] argz.h [ edit | delete | rename | download ]
[FILE] assert.h [ edit | delete | rename | download ]
[FILE] autosprintf.h [ edit | delete | rename | download ]
[FILE] byteswap.h [ edit | delete | rename | download ]
[FILE] com_err.h [ edit | delete | rename | download ]
[FILE] complex.h [ edit | delete | rename | download ]
[FILE] cpio.h [ edit | delete | rename | download ]
[FILE] cpufreq.h [ edit | delete | rename | download ]
[FILE] crypt.h [ edit | delete | rename | download ]
[FILE] ctype.h [ edit | delete | rename | download ]
[FILE] curses.h [ edit | delete | rename | download ]
[FILE] cursesapp.h [ edit | delete | rename | download ]
[FILE] cursesf.h [ edit | delete | rename | download ]
[FILE] cursesm.h [ edit | delete | rename | download ]
[FILE] cursesp.h [ edit | delete | rename | download ]
[FILE] cursesw.h [ edit | delete | rename | download ]
[FILE] cursslk.h [ edit | delete | rename | download ]
[FILE] db.h [ edit | delete | rename | download ]
[FILE] db_185.h [ edit | delete | rename | download ]
[FILE] dbm.h [ edit | delete | rename | download ]
[FILE] dirent.h [ edit | delete | rename | download ]
[FILE] dlfcn.h [ edit | delete | rename | download ]
[FILE] elf.h [ edit | delete | rename | download ]
[FILE] endian.h [ edit | delete | rename | download ]
[FILE] entities.h [ edit | delete | rename | download ]
[FILE] envz.h [ edit | delete | rename | download ]
[FILE] err.h [ edit | delete | rename | download ]
[FILE] errno.h [ edit | delete | rename | download ]
[FILE] error.h [ edit | delete | rename | download ]
[FILE] eti.h [ edit | delete | rename | download ]
[FILE] etip.h [ edit | delete | rename | download ]
[FILE] execinfo.h [ edit | delete | rename | download ]
[FILE] expat.h [ edit | delete | rename | download ]
[FILE] expat_external.h [ edit | delete | rename | download ]
[FILE] fcntl.h [ edit | delete | rename | download ]
[FILE] features.h [ edit | delete | rename | download ]
[FILE] fenv.h [ edit | delete | rename | download ]
[FILE] fmtmsg.h [ edit | delete | rename | download ]
[FILE] fnmatch.h [ edit | delete | rename | download ]
[FILE] form.h [ edit | delete | rename | download ]
[FILE] fpu_control.h [ edit | delete | rename | download ]
[FILE] fstab.h [ edit | delete | rename | download ]
[FILE] fts.h [ edit | delete | rename | download ]
[FILE] ftw.h [ edit | delete | rename | download ]
[FILE] gconv.h [ edit | delete | rename | download ]
[FILE] gcrypt-module.h [ edit | delete | rename | download ]
[FILE] gcrypt.h [ edit | delete | rename | download ]
[FILE] gd.h [ edit | delete | rename | download ]
[FILE] gd_io.h [ edit | delete | rename | download ]
[FILE] gdbm.h [ edit | delete | rename | download ]
[FILE] gdcache.h [ edit | delete | rename | download ]
[FILE] gdfontg.h [ edit | delete | rename | download ]
[FILE] gdfontl.h [ edit | delete | rename | download ]
[FILE] gdfontmb.h [ edit | delete | rename | download ]
[FILE] gdfonts.h [ edit | delete | rename | download ]
[FILE] gdfontt.h [ edit | delete | rename | download ]
[FILE] gdfx.h [ edit | delete | rename | download ]
[FILE] gelf.h [ edit | delete | rename | download ]
[FILE] getopt.h [ edit | delete | rename | download ]
[FILE] gettext-po.h [ edit | delete | rename | download ]
[FILE] glob.h [ edit | delete | rename | download ]
[FILE] gnu-versions.h [ edit | delete | rename | download ]
[FILE] gpg-error.h [ edit | delete | rename | download ]
[FILE] grp.h [ edit | delete | rename | download ]
[FILE] gshadow.h [ edit | delete | rename | download ]
[FILE] gssapi.h [ edit | delete | rename | download ]
[FILE] iconv.h [ edit | delete | rename | download ]
[FILE] idn-free.h [ edit | delete | rename | download ]
[FILE] idn-int.h [ edit | delete | rename | download ]
[FILE] idna.h [ edit | delete | rename | download ]
[FILE] ieee754.h [ edit | delete | rename | download ]
[FILE] ifaddrs.h [ edit | delete | rename | download ]
[FILE] inttypes.h [ edit | delete | rename | download ]
[FILE] jconfig.h [ edit | delete | rename | download ]
[FILE] jerror.h [ edit | delete | rename | download ]
[FILE] jmorecfg.h [ edit | delete | rename | download ]
[FILE] jpeglib.h [ edit | delete | rename | download ]
[FILE] kdb.h [ edit | delete | rename | download ]
[FILE] keyutils.h [ edit | delete | rename | download ]
[FILE] krad.h [ edit | delete | rename | download ]
[FILE] krb5.h [ edit | delete | rename | download ]
[FILE] langinfo.h [ edit | delete | rename | download ]
[FILE] lastlog.h [ edit | delete | rename | download ]
[FILE] lauxlib.h [ edit | delete | rename | download ]
[FILE] lber.h [ edit | delete | rename | download ]
[FILE] lber_types.h [ edit | delete | rename | download ]
[FILE] ldap.h [ edit | delete | rename | download ]
[FILE] ldap_cdefs.h [ edit | delete | rename | download ]
[FILE] ldap_features.h [ edit | delete | rename | download ]
[FILE] ldap_schema.h [ edit | delete | rename | download ]
[FILE] ldap_utf8.h [ edit | delete | rename | download ]
[FILE] ldif.h [ edit | delete | rename | download ]
[FILE] libaio.h [ edit | delete | rename | download ]
[FILE] libelf.h [ edit | delete | rename | download ]
[FILE] libgen.h [ edit | delete | rename | download ]
[FILE] libintl.h [ edit | delete | rename | download ]
[FILE] libio.h [ edit | delete | rename | download ]
[FILE] limits.h [ edit | delete | rename | download ]
[FILE] link.h [ edit | delete | rename | download ]
[FILE] locale.h [ edit | delete | rename | download ]
[FILE] ltdl.h [ edit | delete | rename | download ]
[FILE] lua.h [ edit | delete | rename | download ]
[FILE] lua.hpp [ edit | delete | rename | download ]
[FILE] luaconf.h [ edit | delete | rename | download ]
[FILE] lualib.h [ edit | delete | rename | download ]
[FILE] lzma.h [ edit | delete | rename | download ]
[FILE] malloc.h [ edit | delete | rename | download ]
[FILE] math.h [ edit | delete | rename | download ]
[FILE] mcheck.h [ edit | delete | rename | download ]
[FILE] memory.h [ edit | delete | rename | download ]
[FILE] menu.h [ edit | delete | rename | download ]
[FILE] mntent.h [ edit | delete | rename | download ]
[FILE] monetary.h [ edit | delete | rename | download ]
[FILE] mqueue.h [ edit | delete | rename | download ]
[FILE] nc_tparm.h [ edit | delete | rename | download ]
[FILE] ncurses.h [ edit | delete | rename | download ]
[FILE] ncurses_dll.h [ edit | delete | rename | download ]
[FILE] ndbm.h [ edit | delete | rename | download ]
[FILE] netdb.h [ edit | delete | rename | download ]
[FILE] nl_types.h [ edit | delete | rename | download ]
[FILE] nlist.h [ edit | delete | rename | download ]
[FILE] nss.h [ edit | delete | rename | download ]
[FILE] obstack.h [ edit | delete | rename | download ]
[FILE] panel.h [ edit | delete | rename | download ]
[FILE] paths.h [ edit | delete | rename | download ]
[FILE] pcre.h [ edit | delete | rename | download ]
[FILE] pcre_scanner.h [ edit | delete | rename | download ]
[FILE] pcre_stringpiece.h [ edit | delete | rename | download ]
[FILE] pcrecpp.h [ edit | delete | rename | download ]
[FILE] pcrecpparg.h [ edit | delete | rename | download ]
[FILE] pcreposix.h [ edit | delete | rename | download ]
[FILE] png.h [ edit | delete | rename | download ]
[FILE] pngconf.h [ edit | delete | rename | download ]
[FILE] pnglibconf.h [ edit | delete | rename | download ]
[FILE] poll.h [ edit | delete | rename | download ]
[FILE] pr29.h [ edit | delete | rename | download ]
[FILE] printf.h [ edit | delete | rename | download ]
[FILE] profile.h [ edit | delete | rename | download ]
[FILE] pthread.h [ edit | delete | rename | download ]
[FILE] pty.h [ edit | delete | rename | download ]
[FILE] punycode.h [ edit | delete | rename | download ]
[FILE] pwd.h [ edit | delete | rename | download ]
[FILE] re_comp.h [ edit | delete | rename | download ]
[FILE] regex.h [ edit | delete | rename | download ]
[FILE] regexp.h [ edit | delete | rename | download ]
[FILE] resolv.h [ edit | delete | rename | download ]
[FILE] sched.h [ edit | delete | rename | download ]
[FILE] search.h [ edit | delete | rename | download ]
[FILE] semaphore.h [ edit | delete | rename | download ]
[FILE] setjmp.h [ edit | delete | rename | download ]
[FILE] sgtty.h [ edit | delete | rename | download ]
[FILE] shadow.h [ edit | delete | rename | download ]
[FILE] signal.h [ edit | delete | rename | download ]
[FILE] slapi-plugin.h [ edit | delete | rename | download ]
[FILE] spawn.h [ edit | delete | rename | download ]
[FILE] stab.h [ edit | delete | rename | download ]
[FILE] stdc-predef.h [ edit | delete | rename | download ]
[FILE] stdint.h [ edit | delete | rename | download ]
[FILE] stdio.h [ edit | delete | rename | download ]
[FILE] stdio_ext.h [ edit | delete | rename | download ]
[FILE] stdlib.h [ edit | delete | rename | download ]
[FILE] string.h [ edit | delete | rename | download ]
[FILE] stringprep.h [ edit | delete | rename | download ]
[FILE] strings.h [ edit | delete | rename | download ]
[FILE] syscall.h [ edit | delete | rename | download ]
[FILE] sysexits.h [ edit | delete | rename | download ]
[FILE] syslog.h [ edit | delete | rename | download ]
[FILE] tar.h [ edit | delete | rename | download ]
[FILE] tcpd.h [ edit | delete | rename | download ]
[FILE] term.h [ edit | delete | rename | download ]
[FILE] term_entry.h [ edit | delete | rename | download ]
[FILE] termcap.h [ edit | delete | rename | download ]
[FILE] termio.h [ edit | delete | rename | download ]
[FILE] termios.h [ edit | delete | rename | download ]
[FILE] tgmath.h [ edit | delete | rename | download ]
[FILE] thread_db.h [ edit | delete | rename | download ]
[FILE] tic.h [ edit | delete | rename | download ]
[FILE] tiff.h [ edit | delete | rename | download ]
[FILE] tiffconf-64.h [ edit | delete | rename | download ]
[FILE] tiffconf.h [ edit | delete | rename | download ]
[FILE] tiffio.h [ edit | delete | rename | download ]
[FILE] tiffio.hxx [ edit | delete | rename | download ]
[FILE] tiffvers.h [ edit | delete | rename | download ]
[FILE] time.h [ edit | delete | rename | download ]
[FILE] tld.h [ edit | delete | rename | download ]
[FILE] ttyent.h [ edit | delete | rename | download ]
[FILE] uchar.h [ edit | delete | rename | download ]
[FILE] ucontext.h [ edit | delete | rename | download ]
[FILE] ulimit.h [ edit | delete | rename | download ]
[FILE] unctrl.h [ edit | delete | rename | download ]
[FILE] unistd.h [ edit | delete | rename | download ]
[FILE] ustat.h [ edit | delete | rename | download ]
[FILE] utime.h [ edit | delete | rename | download ]
[FILE] utmp.h [ edit | delete | rename | download ]
[FILE] utmpx.h [ edit | delete | rename | download ]
[FILE] values.h [ edit | delete | rename | download ]
[FILE] verto-module.h [ edit | delete | rename | download ]
[FILE] verto.h [ edit | delete | rename | download ]
[FILE] wait.h [ edit | delete | rename | download ]
[FILE] wchar.h [ edit | delete | rename | download ]
[FILE] wctype.h [ edit | delete | rename | download ]
[FILE] wordexp.h [ edit | delete | rename | download ]
[FILE] xlocale.h [ edit | delete | rename | download ]
[FILE] zconf.h [ edit | delete | rename | download ]
[FILE] zlib.h [ edit | delete | rename | download ]

Viewing: /usr/include/pcrecpparg.h

// Copyright (c) 2005, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//     * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//     * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//     * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: Sanjay Ghemawat

#ifndef _PCRECPPARG_H
#define _PCRECPPARG_H

#include <stdlib.h>    // for NULL
#include <string>

#include <pcre.h>

namespace pcrecpp {

class StringPiece;

// Hex/Octal/Binary?

// Special class for parsing into objects that define a ParseFrom() method
template <class T>
class _RE_MatchObject {
 public:
  static inline bool Parse(const char* str, int n, void* dest) {
    if (dest == NULL) return true;
    T* object = reinterpret_cast<T*>(dest);
    return object->ParseFrom(str, n);
  }
};

class PCRECPP_EXP_DEFN Arg {
 public:
  // Empty constructor so we can declare arrays of Arg
  Arg();

  // Constructor specially designed for NULL arguments
  Arg(void*);

  typedef bool (*Parser)(const char* str, int n, void* dest);

// Type-specific parsers
#define PCRE_MAKE_PARSER(type,name)                             \
  Arg(type* p) : arg_(p), parser_(name) { }                     \
  Arg(type* p, Parser parser) : arg_(p), parser_(parser) { }


  PCRE_MAKE_PARSER(char,               parse_char);
  PCRE_MAKE_PARSER(unsigned char,      parse_uchar);
  PCRE_MAKE_PARSER(short,              parse_short);
  PCRE_MAKE_PARSER(unsigned short,     parse_ushort);
  PCRE_MAKE_PARSER(int,                parse_int);
  PCRE_MAKE_PARSER(unsigned int,       parse_uint);
  PCRE_MAKE_PARSER(long,               parse_long);
  PCRE_MAKE_PARSER(unsigned long,      parse_ulong);
#if 1
  PCRE_MAKE_PARSER(long long,          parse_longlong);
#endif
#if 1
  PCRE_MAKE_PARSER(unsigned long long, parse_ulonglong);
#endif
  PCRE_MAKE_PARSER(float,              parse_float);
  PCRE_MAKE_PARSER(double,             parse_double);
  PCRE_MAKE_PARSER(std::string,        parse_string);
  PCRE_MAKE_PARSER(StringPiece,        parse_stringpiece);

#undef PCRE_MAKE_PARSER

  // Generic constructor
  template <class T> Arg(T*, Parser parser);
  // Generic constructor template
  template <class T> Arg(T* p)
    : arg_(p), parser_(_RE_MatchObject<T>::Parse) {
  }

  // Parse the data
  bool Parse(const char* str, int n) const;

 private:
  void*         arg_;
  Parser        parser_;

  static bool parse_null          (const char* str, int n, void* dest);
  static bool parse_char          (const char* str, int n, void* dest);
  static bool parse_uchar         (const char* str, int n, void* dest);
  static bool parse_float         (const char* str, int n, void* dest);
  static bool parse_double        (const char* str, int n, void* dest);
  static bool parse_string        (const char* str, int n, void* dest);
  static bool parse_stringpiece   (const char* str, int n, void* dest);

#define PCRE_DECLARE_INTEGER_PARSER(name)                                   \
 private:                                                                   \
  static bool parse_ ## name(const char* str, int n, void* dest);           \
  static bool parse_ ## name ## _radix(                                     \
    const char* str, int n, void* dest, int radix);                         \
 public:                                                                    \
  static bool parse_ ## name ## _hex(const char* str, int n, void* dest);   \
  static bool parse_ ## name ## _octal(const char* str, int n, void* dest); \
  static bool parse_ ## name ## _cradix(const char* str, int n, void* dest)

  PCRE_DECLARE_INTEGER_PARSER(short);
  PCRE_DECLARE_INTEGER_PARSER(ushort);
  PCRE_DECLARE_INTEGER_PARSER(int);
  PCRE_DECLARE_INTEGER_PARSER(uint);
  PCRE_DECLARE_INTEGER_PARSER(long);
  PCRE_DECLARE_INTEGER_PARSER(ulong);
  PCRE_DECLARE_INTEGER_PARSER(longlong);
  PCRE_DECLARE_INTEGER_PARSER(ulonglong);

#undef PCRE_DECLARE_INTEGER_PARSER
};

inline Arg::Arg() : arg_(NULL), parser_(parse_null) { }
inline Arg::Arg(void* p) : arg_(p), parser_(parse_null) { }

inline bool Arg::Parse(const char* str, int n) const {
  return (*parser_)(str, n, arg_);
}

// This part of the parser, appropriate only for ints, deals with bases
#define MAKE_INTEGER_PARSER(type, name) \
  inline Arg Hex(type* ptr) { \
    return Arg(ptr, Arg::parse_ ## name ## _hex); } \
  inline Arg Octal(type* ptr) { \
    return Arg(ptr, Arg::parse_ ## name ## _octal); } \
  inline Arg CRadix(type* ptr) { \
    return Arg(ptr, Arg::parse_ ## name ## _cradix); }

MAKE_INTEGER_PARSER(short,              short)     /*                        */
MAKE_INTEGER_PARSER(unsigned short,     ushort)    /*                        */
MAKE_INTEGER_PARSER(int,                int)       /* Don't use semicolons   */
MAKE_INTEGER_PARSER(unsigned int,       uint)      /* after these statement  */
MAKE_INTEGER_PARSER(long,               long)      /* because they can cause */
MAKE_INTEGER_PARSER(unsigned long,      ulong)     /* compiler warnings if   */
#if 1                          /* the checking level is  */
MAKE_INTEGER_PARSER(long long,          longlong)  /* turned up high enough. */
#endif                                             /*                        */
#if 1                         /*                        */
MAKE_INTEGER_PARSER(unsigned long long, ulonglong) /*                        */
#endif

#undef PCRE_IS_SET
#undef PCRE_SET_OR_CLEAR
#undef MAKE_INTEGER_PARSER

}   // namespace pcrecpp


#endif /* _PCRECPPARG_H */

Upload File: