NAME

OTC_Globex - Class to perform shell style globbing on a string.

SYNOPSIS


#include <OTC/text/globex.hh>

class OTC_Globex : public OTC_Pattern
{
  public:
    static os_typespec* get_os_typespec();
    ~OTC_Globex();
    OTC_Globex(char const* thePattern);
    OTC_Boolean match(char const* theString);
    u_int start() const;
    u_int length() const;
    OTC_Boolean isValid() const;
    char const* error() const;
  protected:
    int doMatch(char const* thePattern, char const* theString);
    int doMatchStar(char const* thePattern, char const* theString);
    void compile();
};

CLASS TYPE

Concrete

DESCRIPTION

This class provides the ability to determine if a string matches a particular pattern. The pattern in this case is in the form of a shell style globbing pattern.

INITIALISATION

OTC_Globex(char const* thePattern);

MATCHING

OTC_Boolean match(char const* theString);
u_int start() const;
u_int length() const;

ERRORS

OTC_Boolean isValid() const;
char const* error() const;

COMPILATION

void compile();

FORMAT

In the pattern string: Note: the standard regex character '+' (one or more) should by simulated by using "?*" which is equivalent here. A set is composed of characters or ranges; a range looks like character hyphen character (as in 0-9 or A-Z). [0-9a-zA-Z_] is the minimal set of characters allowed in the [..] pattern construct. To suppress the special syntactic significance of any of `[]*?!^-\\', and match the character exactly, precede it with a `\\'.

SOURCE

This class is based on public domain routines written by J. Kercheval (johnk@wrq.com) and posted to alt.sources.

SEE ALSO

OTC_Pattern

LIBRARY

OTC

AUTHOR(S)

Graham Dumpleton

COPYRIGHT

Copyright 1991 OTC LIMITED
Copyright 1994 DUMPLETON SOFTWARE CONSULTING PTY LIMITED