Ipelib

- Main Page
- Related Pages
- Modules
- Classes

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | List of all members
ipe::Lex Class Reference
Ipe Base

`#include <ipebase.h>`

## Public Member Functions
| Lex (String str)
String | token ()
String | nextToken ()
int | getInt ()
int | getHexByte ()
Fixed | getFixed ()
unsigned long int | getHexNumber ()
double | getDouble ()
char | getChar ()
void | skipWhitespace ()
Lex & | operator>> (int &i)
Lex & | operator>> (double &d)
Lex & | operator>> (Fixed &d)
void | mark ()
void | fromMark ()
bool | eos () const

## Detailed Description

Lexical analyser. Seeded with a string.

## Constructor & Destructor Documentation

Lex::Lex | ( | String | str | ) |
| explicit

Construct lexical analyzer from a string.

Referenced by ipe::Fixed::operator<<().

## Member Function Documentation

String Lex::token | ( |  | ) |

Return NextToken, but without extracting it.

Referenced by ipe::Shape::load().

String Lex::nextToken | ( |  | ) |

Extract next token.

Skips any whitespace before the token. Returns empty string if end of string is reached.

Referenced by ipe::Shape::load(), and ipe::ImlParser::parsePage().

int Lex::getInt | ( |  | ) |

Extract integer token (skipping whitespace).

References ipe::String::z().

Referenced by ipe::Bitmap::Bitmap(), ipe::ImlParser::parseBitmap(), ipe::ImlParser::parseObject(), and ipe::ImlParser::parseStyle().

int Lex::getHexByte | ( |  | ) |

Extract byte in hex (skipping whitespace).

Referenced by ipe::Bitmap::Bitmap(), and ipe::PdfString::decode().

Fixed Lex::getFixed | ( |  | ) |

Extract Fixed token (skipping whitespace).

References ipe::Fixed::fromInternal(), ipe::String::size(), ipe::String::substr(), and ipe::String::z().

unsigned long int Lex::getHexNumber | ( |  | ) |

Extract hexadecimal token (skipping whitespace).

References ipe::String::z().

Referenced by ipe::Bitmap::Bitmap().

double Lex::getDouble | ( |  | ) |

Extract double token (skipping whitespace).

References ipe::Platform::toDouble().

Referenced by ipe::ImlParser::parseStyle(), and ipe::Text::Text().

char ipe::Lex::getChar | ( |  | ) |
| inline

Extract next character (not skipping anything).

void Lex::skipWhitespace | ( |  | ) |

Skip over whitespace.

References ipe::Buffer::Buffer(), and ipe::String::size().

Referenced by ipe::Shape::load(), and ipe::ImlParser::parsePage().

Lex& ipe::Lex::operator>> | ( | int & | i | ) |
| inline

Operator syntax for getInt().

Lex& ipe::Lex::operator>> | ( | double & | d | ) |
| inline

Operator syntax for getDouble().

Lex& ipe::Lex::operator>> | ( | Fixed & | d | ) |
| inline

Operator syntax for getFixed().

void ipe::Lex::mark | ( |  | ) |
| inline

Mark the current position.

void ipe::Lex::fromMark | ( |  | ) |
| inline

Reset reader to the marked position.

bool ipe::Lex::eos | ( |  | ) | const
| inline

Return true if at end of string (not even whitespace left).

Referenced by ipe::Color::Color(), ipe::PdfString::decode(), ipe::Shape::load(), and ipe::ImlParser::parsePage().

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

- ipebase.h
- ipebase.cpp