JKQTPlotter trunk/v5.0.0
an extensive Qt5+Qt6 Plotter framework (including a feature-richt plotter widget, a speed-optimized, but limited variant and a LaTeX equation renderer!), written fully in C/C++ and without external dependencies
Loading...
Searching...
No Matches

#include <jkqtpcsstools.h>

Public Types

enum  TokenType {
  END ,
  NAME ,
  NUMBER ,
  HEXSTRING ,
  LBRACKET ,
  RBRACKET ,
  COMMA ,
  SLASH
}
 the possible Token that can be recognized by the tokenizer in JKQTPCSSParser::getToken()
More...
 

Public Member Functions

 Token ()
 
 Token (const QString &str, TokenType type=NAME)
 
 Token (double num, const QString &unit_=QString())
 
 Token (TokenType type)
 
QString getNormString () const
 normlizes the StringValue (i.e. lower-case, trimmer, simmplified)
 
bool is (TokenType othertype) const
 checks whether the current token is of the given type (does not compare any other field)
 
bool isNormString (const QString &name) const
 checks whether the current token is of type TokenType::NAME and the String value equals name (case-insensitive commparison, trimmer, simplified)
 
bool isNormStringAnyOf (const QStringList &names) const
 checks whether the current token is of type TokenType::NAME and the String value equals any of the entries in names (case-insensitive commparison, trimmer, simplified)
 
QString toString () const
 converts the TOken information to a string
 

Static Public Member Functions

static QString toString (TokenType type)
 

Public Attributes

double NumberValue
 the string value of the current token (when applicable) during the parsing step
 
QString StringValue
 the string value of the current token (when applicable) during the parsing step
 
TokenType type
 

Member Enumeration Documentation

◆ TokenType

the possible Token that can be recognized by the tokenizer in JKQTPCSSParser::getToken()

Enumerator
END 

end token

NAME 

a name (consisting of characters) of a variable or function

NUMBER 

a number, possibly with a unit(string)

HEXSTRING 

a string in HEX notation (i.e. 0-9a-fA-F)

LBRACKET 

left brackets '('

RBRACKET 

right brackets ')'

COMMA 

a comma ','

SLASH 

a slash '/'

Constructor & Destructor Documentation

◆ Token() [1/4]

JKQTPCSSParser::Token::Token ( )

◆ Token() [2/4]

JKQTPCSSParser::Token::Token ( TokenType  type)

◆ Token() [3/4]

JKQTPCSSParser::Token::Token ( double  num,
const QString &  unit_ = QString() 
)

◆ Token() [4/4]

JKQTPCSSParser::Token::Token ( const QString &  str,
TokenType  type = NAME 
)

Member Function Documentation

◆ getNormString()

QString JKQTPCSSParser::Token::getNormString ( ) const
inline

normlizes the StringValue (i.e. lower-case, trimmer, simmplified)

◆ is()

bool JKQTPCSSParser::Token::is ( TokenType  othertype) const
inline

checks whether the current token is of the given type (does not compare any other field)

◆ isNormString()

bool JKQTPCSSParser::Token::isNormString ( const QString &  name) const
inline

checks whether the current token is of type TokenType::NAME and the String value equals name (case-insensitive commparison, trimmer, simplified)

◆ isNormStringAnyOf()

bool JKQTPCSSParser::Token::isNormStringAnyOf ( const QStringList &  names) const
inline

checks whether the current token is of type TokenType::NAME and the String value equals any of the entries in names (case-insensitive commparison, trimmer, simplified)

◆ toString() [1/2]

QString JKQTPCSSParser::Token::toString ( ) const

converts the TOken information to a string

◆ toString() [2/2]

static QString JKQTPCSSParser::Token::toString ( TokenType  type)
static

Member Data Documentation

◆ NumberValue

double JKQTPCSSParser::Token::NumberValue

the string value of the current token (when applicable) during the parsing step

◆ StringValue

QString JKQTPCSSParser::Token::StringValue

the string value of the current token (when applicable) during the parsing step

◆ type

TokenType JKQTPCSSParser::Token::type

The documentation for this struct was generated from the following file: