6.4.1 Regexp::Property

The Regexp::Property class is used to tell the Regexp class how a given regular expression should be interpreted, and how the case should be handled. The class itself defines syntax and case enumerates, and stores a syntax-case pair. There are basic, extended, and shell regular expressions, and a regular expression can be case sensitive or case insensitive. The shell syntax was added to allow shell wildcard pattern like expressions. The later are not defined as regular expressions in the POSIX standard, but in LYRIC they are treated as regular expressions. They look like regular expressions; it’s only the interpretation of the syntax that is different. The Regexp::Property class allows you to choose your favourite syntax, and to tell whether case must be differentiated or ignored.


  #include <lyric/Regexp.hpp>
  class Regexp::Property
    friend class Regexp;
    enum Syntax { Basic, Extended, Shell };
    enum Case { Differentiate, Ignore };
    ~Regexp::Property ();
    Regexp::Property ();
    Regexp::Property (Syntax syntax, Case vcase);
    Regexp::Property (const Regexp::Property& property);
    Regexp::Property& operator = (const Regexp::Property& property);


˜Regexp::Property ()
Destroys this regular expression property, releasing all used memroy resources.

Regexp::Property ()
Constructs this regular expression with the default syntax set to Extended, and the default case to Differentiate.

Regexp::Property (Syntax syntax, Case vcase)
Constructs this regular expression with the given syntax and vcase properties.

Regexp::Property (const Regexp::Property& property)
Constructs this regular expression property from the given property. All values stored in property are copied into this regular expression property.

Regexp::Property& operator = (const Regexp::Property& property)
Assigns the given property to this regular expression property. A reference to this is returned for assignment chaining. All values stored in the given property are copied into this regular expression property.