class Poco::WhitespaceToken

Overview

This pseudo token class is used to eat up whitespace in between real tokens. More…

#include <Token.h>

class WhitespaceToken: public Poco::Token
{
public:
    // methods

    virtual
    Class
    tokenClass() const;

    virtual
    bool
    start(
        char c,
        std::istream& istr
        );

    virtual
    void
    finish(std::istream& istr);
};

Inherited Members

public:
    // enums

    enum Class;

    // methods

    virtual
    bool
    start(
        char c,
        std::istream& istr
        );

    virtual
    void
    finish(std::istream& istr);

    virtual
    Class
    tokenClass() const;

    const std::string&
    tokenString() const;

    virtual
    std::string
    asString() const;

    virtual
    int
    asInteger() const;

    virtual
    unsigned
    asUnsignedInteger() const;

    virtual
    double
    asFloat() const;

    virtual
    char
    asChar() const;

    bool
    is(Class tokenClass) const;

protected:
    // fields

    std::string _value;

Detailed Documentation

This pseudo token class is used to eat up whitespace in between real tokens.

Methods

virtual
Class
tokenClass() const

Returns the kind of the token.

virtual
bool
start(
    char c,
    std::istream& istr
    )

Checks if the given character (and, optionally, the next character in the input stream) start a valid token.

Returns true if so, false otherwise.

The current read position in istr must not be changed. In other words, only the peek() method of istream may be used.

If the character starts the token, it should be set as the token’s value.

virtual
void
finish(std::istream& istr)

Builds the token by reading and appending the remaining characters from istr.