class Poco::Util::Validator

Overview

Validator specifies the interface for option validators. Moreā€¦

#include <Validator.h>

class Validator: public Poco::RefCountedObject
{
public:
    // methods

    virtual
    void
    validate(
        const Option& option,
        const std::string& value
        ) = 0;
};

// direct descendants

class IntValidator;
class RegExpValidator;

Inherited Members

public:
    // methods

    void
    duplicate() const;

    void
    release() const;

    int
    referenceCount() const;

Detailed Documentation

Validator specifies the interface for option validators.

Option validators provide a simple way for the automatic validation of command line argument values.

Construction

virtual
~Validator()

Destroys the Validator.

Methods

virtual
void
validate(
    const Option& option,
    const std::string& value
    ) = 0

Validates the value for the given option.

Does nothing if the value is valid.

Throws an OptionException otherwise.