Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
Public Types | Public Member Functions | Friends
sax::Token Class Reference

#include <Token.h>

Public Types

enum class  TokenType {
  START_ELEMENT , END_ELEMENT , START_ATTRIBUTE , END_ATTRIBUTE ,
  CHARACTER
}
 

Public Member Functions

 Token (std::string, TokenType)
 
const std::string & getData () const &
 
std::string && getData () &&
 
TokenType getType () const
 
bool operator== (const Token &other) const
 

Friends

std::ostream & operator<< (std::ostream &os, const Token &token)
 

Detailed Description

Represents part of parsed XML. Can be start of tag, end of tag, tag attribute or array of characters.

Member Enumeration Documentation

◆ TokenType

enum class sax::Token::TokenType
strong
Enumerator
START_ELEMENT 
END_ELEMENT 
START_ATTRIBUTE 
END_ATTRIBUTE 
CHARACTER 

Constructor & Destructor Documentation

◆ Token()

sax::Token::Token ( std::string  tokenData,
Token::TokenType  tokenType 
)

Member Function Documentation

◆ getData() [1/2]

std::string && sax::Token::getData ( ) &&
Returns
name of the tag or characters read

◆ getData() [2/2]

const std::string & sax::Token::getData ( ) const &
Returns
name of the tag or characters read

◆ getType()

Token::TokenType sax::Token::getType ( ) const
Returns
type of the token - star of the tag, end of the tag, attribute of the tag or characters

◆ operator==()

bool sax::Token::operator== ( const Token other) const

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const Token token 
)
friend

The documentation for this class was generated from the following files: