appkit  1.5.1
RoadNarrows Robotics Application Kit
utRegEx.cxx File Reference

Unit test RegEx class. More...

#include <unistd.h>
#include <termios.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <iostream>
#include <fstream>
#include <string>
#include "rnr/rnrconfig.h"
#include "rnr/log.h"
#include "rnr/opts.h"
#include "rnr/pkg.h"
#include "rnr/appkit/RegEx.h"
#include "version.h"

Go to the source code of this file.

Macros

#define APP_EC_OK   0
 success exit code
 
#define APP_EC_ARGS   2
 command-line options/arguments error exit code
 
#define APP_EC_EXEC   4
 execution exit code
 

Functions

static string getline (istream &is)
 
static void utPr (ostream &os, const string name, const RegEx &re)
 Print RegEx data. More...
 
static void utConstRe (ostream &os, const RegEx &re)
 Print RegEx data. More...
 
static void utRun (ostream &os)
 Test RegEx operations.
 
static void mainInit (int argc, char *argv[])
 Main initialization. More...
 
int main (int argc, char *argv[])
 Main. More...
 

Variables

static char * Argv0
 the command
 
static double OptsHz = 2
 thread hertz rate
 
static OptsPgmInfo_T PgmInfo
 Program information. More...
 
static OptsInfo_T OptsInfo []
 Command line options information. More...
 
const RegEx re0
 Globally constructed, pre-compiled re's.
 
const RegEx re1 ("^[a-z]*$", RegEx::ReFlagICase)
 
RegEx re2 = re1
 
const RegEx re3 ("['\"]{1,2}([0-9]+)(hello)(^)")
 
const RegEx re4 ("^[a-z]*$")
 
RegEx reGo = "([cC]at)|([dD]og)"
 

Detailed Description

Unit test RegEx class.

Author
Robin Knight (robin.nosp@m..kni.nosp@m.ght@r.nosp@m.oadn.nosp@m.arrow.nosp@m.s.co.nosp@m.m)
Copyright
© 2017-2017. RoadNarrows LLC.
http://www.roadnarrows.com
All Rights Reserved

Definition in file utRegEx.cxx.

Function Documentation

static void mainInit ( int  argc,
char *  argv[] 
)
static

Main initialization.

Parameters
argcCommand-line argument count.
argvCommand-line argument list.
Exits:
Program terminates on conversion error.

Definition at line 263 of file utRegEx.cxx.

References APP_EC_OK, Argv0, main(), OptsInfo, PgmInfo, PkgInfo, utConstRe(), utPr(), and utRun().

264 {
265  // name of this process
266  Argv0 = basename(argv[0]);
267 
268  // parse input options
269  argv = OptsGet(Argv0, &PkgInfo, &PgmInfo, OptsInfo, true, &argc, argv);
270 }
static char * Argv0
the command
Definition: utRegEx.cxx:59
static OptsInfo_T OptsInfo[]
Command line options information.
Definition: utRegEx.cxx:83
static const PkgInfo_T PkgInfo
Definition: version.h:45
static OptsPgmInfo_T PgmInfo
Program information.
Definition: utRegEx.cxx:65