EPICS functions for testing strings against each other. More...
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <errno.h>
#include <math.h>
#include <exception>
#include <algorithm>
#include <stdexcept>
#include <iostream>
#include <map>
#include <list>
#include <string>
#include <time.h>
#include <sstream>
#include <fstream>
#include <vector>
#include <memory>
#include "epicsStdlib.h"
#include "epicsString.h"
#include "dbDefs.h"
#include "epicsMutex.h"
#include "dbBase.h"
#include "dbStaticLib.h"
#include "dbFldTypes.h"
#include "dbCommon.h"
#include "dbAccessDefs.h"
#include <epicsTypes.h>
#include <epicsTime.h>
#include <epicsThread.h>
#include <epicsTimer.h>
#include <iocsh.h>
#include "envDefs.h"
#include "macLib.h"
#include "errlog.h"
#include "postfix.h"
#include "cvtFast.h"
#include <boost/scoped_array.hpp>
#include <registryFunction.h>
#include <epicsExport.h>
#include "utilities.h"
Go to the source code of this file.
Functions | |
static int | stringtestres (const char *lhs, int operation, const char *rhs) |
Does the actual calculation comparing the given strings to each other. More... | |
static void | iocstringtest (const char *resultvar, const char *lhs, int operation, const char *rhs) |
Compares the given strings based on the operation flag and returns ' ' on true and '#' on false into the resultvar macro. More... | |
static void | iocstringiftest (const char *resultvar, const char *lhs, int operation, const char *rhs) |
Compares the given strings based on the operation flag, putting the result in two different macros. More... | |
static void | stringtestInitCallFunc (const iocshArgBuf *args) |
static void | stringiftestInitCallFunc (const iocshArgBuf *args) |
static void | iocstringtestRegister (void) |
epicsExportRegistrar (iocstringtestRegister) | |
Variables | |
static const iocshArg | stringtestInitArg0 = { "resultvar", iocshArgString } |
The name of the macro to put the result of the calculation into. More... | |
static const iocshArg | stringtestInitArg1 = { "lhs", iocshArgString } |
The left hand side argument. More... | |
static const iocshArg | stringtestInitArg2 = { "operation", iocshArgInt } |
The operation to perform on the string. More... | |
static const iocshArg | stringtestInitArg3 = { "rhs", iocshArgString } |
The right hand side argument. More... | |
static const iocshArg *const | stringtestInitArgs [] = { &stringtestInitArg0, &stringtestInitArg1, &stringtestInitArg2, &stringtestInitArg3 } |
static const iocshFuncDef | stringtestInitFuncDef = {"stringtest", sizeof(stringtestInitArgs) / sizeof(iocshArg*), stringtestInitArgs} |
static const iocshArg | stringiftestInitArg0 = { "resultvar", iocshArgString } |
The name of the macro to put the result of the calculation into. More... | |
static const iocshArg | stringiftestInitArg1 = { "lhs", iocshArgString } |
The left hand side argument. More... | |
static const iocshArg | stringiftestInitArg2 = { "operation", iocshArgInt } |
The operation to perform on the string. More... | |
static const iocshArg | stringiftestInitArg3 = { "rhs", iocshArgString } |
The right hand side argument. More... | |
static const iocshArg *const | stringiftestInitArgs [] = { &stringiftestInitArg0, &stringiftestInitArg1, &stringiftestInitArg2, &stringiftestInitArg3 } |
static const iocshFuncDef | stringiftestInitFuncDef = {"stringiftest", sizeof(stringiftestInitArgs) / sizeof(iocshArg*), stringiftestInitArgs} |
EPICS functions for testing strings against each other.
Definition in file iocstringtest.cpp.
epicsExportRegistrar | ( | iocstringtestRegister | ) |
|
static |
Compares the given strings based on the operation flag, putting the result in two different macros.
This function will create two macros called IFresultvar and IFNOTresultvar. If the comparison is true a '#' will be placed in IFNOTresultvar. If the comparison is false a '#' will be placed in IFresultvar.
E.g. to check if a macro named DO_I_EXIST does actually exist then do some follow up:
to check a macro named AM_I_CORRECT is equal to CORRECT_ANSWER then do some follow up:
[in] | resultvar | The name of the macro to put the result of the calculation into. |
[in] | lhs | The left hand side argument. |
[in] | operation | The operation to perform on the string. 0x1: verbose 0x2: strlen(lhs) > 0 (default) 0x4: lhs == rhs 0x8: reverse the above logic |
[in] | rhs | The right hand side argument. |
Definition at line 171 of file iocstringtest.cpp.
References stringtestres().
Referenced by stringiftestInitCallFunc().
|
static |
Compares the given strings based on the operation flag and returns ' ' on true and '#' on false into the resultvar macro.
E.g. to check if a macro named DO_I_EXIST does actually exist and put the result in a macro called EXISTS:
[in] | resultvar | The name of the macro to put the result of the calculation into. |
[in] | lhs | The left hand side argument. |
[in] | operation | The operation to perform on the string. 0x1: verbose 0x2: strlen(lhs) > 0 (default) 0x4: lhs == rhs 0x8: reverse the above logic |
[in] | rhs | The right hand side argument. |
Definition at line 126 of file iocstringtest.cpp.
References stringtestres().
Referenced by stringtestInitCallFunc().
|
static |
Definition at line 247 of file iocstringtest.cpp.
References stringiftestInitCallFunc(), and stringtestInitCallFunc().
|
static |
Definition at line 242 of file iocstringtest.cpp.
References iocstringiftest().
Referenced by iocstringtestRegister().
|
static |
Definition at line 223 of file iocstringtest.cpp.
References iocstringtest().
Referenced by iocstringtestRegister().
|
static |
Does the actual calculation comparing the given strings to each other.
Helper function, not to be called from an IOC.
Definition at line 57 of file iocstringtest.cpp.
Referenced by iocstringiftest(), and iocstringtest().
|
static |
The name of the macro to put the result of the calculation into.
Definition at line 228 of file iocstringtest.cpp.
|
static |
The left hand side argument.
Definition at line 229 of file iocstringtest.cpp.
|
static |
The operation to perform on the string.
0x1: verbose 0x2: strlen(lhs) > 0 (default) 0x4: lhs == rhs 0x8: reverse the above logic
Definition at line 236 of file iocstringtest.cpp.
|
static |
The right hand side argument.
Definition at line 237 of file iocstringtest.cpp.
|
static |
Definition at line 238 of file iocstringtest.cpp.
|
static |
Definition at line 240 of file iocstringtest.cpp.
|
static |
The name of the macro to put the result of the calculation into.
Definition at line 209 of file iocstringtest.cpp.
|
static |
The left hand side argument.
Definition at line 210 of file iocstringtest.cpp.
|
static |
The operation to perform on the string.
0x1: verbose 0x2: strlen(lhs) > 0 (default) 0x4: lhs == rhs 0x8: reverse the above logic
Definition at line 217 of file iocstringtest.cpp.
|
static |
The right hand side argument.
Definition at line 218 of file iocstringtest.cpp.
|
static |
Definition at line 219 of file iocstringtest.cpp.
|
static |
Definition at line 221 of file iocstringtest.cpp.