NAME

OTC_TracePattern - Trace switch enabled through a pattern definition.

SYNOPSIS


#include <OTC/text/tracepat.hh>

class OTC_TracePattern : public OTC_TraceSwitch
{
  public:
    ~OTC_TracePattern();
    OTC_TracePattern(char const* theString);
    OTC_Boolean enabled() const;
    inline char const* string() const;
    static void set(char const* thePattern);
};

CLASS TYPE

Concrete

DESCRIPTION

The class OTC_TracePattern is a derived version of the class OTC_TraceSwitch, where the switch is enabled if the string associated with the switch matches a regular expression. The regular expression used to perform the match, can be defined using the environment variable OTCLIB_TRACEPATTER, or through program control. If set under program control, all switches will be reevaluated at that point and their status reset accordingly. The type of pattern excepted is that of an egrep style pattern, as implemented by the OTC_Regexp class. Macros are also provided for creating and setting the pattern. Code for these macros will be compiled into your code, only if the preprocessor symbol OTCLIB_TRACE is defined. These macros are OTCLIB_TRACEPATTERN, OTCLIB_STATIC_TRACEPATTERN and OTCLIB_SETTRACEPATTERN. The macro OTCLIB_STATIC_TRACEPATTERN creates an instance of the class which has static extent.

INITIALISATION

OTC_TracePattern(char const* theString);

QUERY/CHANGE

OTC_Boolean enabled() const;
inline char const* string() const;
static void set(char const* thePattern);

SEE ALSO

OTC_TraceSwitch, OTC_Regexp

LIBRARY

OTC

AUTHOR(S)

Graham Dumpleton

COPYRIGHT

Copyright 1993 TELSTRA CORPORATION LIMITED
Copyright 1994 DUMPLETON SOFTWARE CONSULTING PTY LIMITED