MPD: Tokenizer Class Reference

MPD 0.20.18

Public Member Functions
Tokenizer Class Reference

`#include <Tokenizer.hxx>`

## Public Member Functions
constexpr | Tokenizer (char *_input)
| Tokenizer (const Tokenizer &)=delete
Tokenizer & | operator= (const Tokenizer &)=delete
char * | Rest ()
char | CurrentChar () const
bool | IsEnd () const
char * | NextWord ()
| Reads the next word. More...
char * | NextUnquoted ()
| Reads the next unquoted word from the input string. More...
char * | NextString ()
| Reads the next quoted string from the input string. More...
char * | NextParam ()
| Reads the next unquoted word or quoted string from the input. More...

## Detailed Description

Definition at line 33 of file Tokenizer.hxx.

## Constructor & Destructor Documentation

## ◆ Tokenizer() [1/2]

constexpr Tokenizer::Tokenizer | ( | char * | _input | ) |
| inline

Parameters

  _input | the input string; the contents will be modified by this class

Definition at line 41 of file Tokenizer.hxx.

## ◆ Tokenizer() [2/2]

Tokenizer::Tokenizer | ( | const Tokenizer & |  | ) |
| delete

## Member Function Documentation

## ◆ CurrentChar()

char Tokenizer::CurrentChar | ( |  | ) | const
| inline

Definition at line 50 of file Tokenizer.hxx.

## ◆ IsEnd()

bool Tokenizer::IsEnd | ( |  | ) | const
| inline

Definition at line 54 of file Tokenizer.hxx.

## ◆ NextParam()

char* Tokenizer::NextParam | ( |  | ) |

Reads the next unquoted word or quoted string from the input.

This is a wrapper for NextUnquoted() and NextString(). Throws std::runtime_error on error.

Returns
  a pointer to the null-terminated string, or nullptr on end of line

## ◆ NextString()

char* Tokenizer::NextString | ( |  | ) |

Reads the next quoted string from the input string.

A backslash escapes the following character. This function modifies the input string. Throws std::runtime_error on error.

Returns
  a pointer to the null-terminated string, or nullptr end of line

## ◆ NextUnquoted()

char* Tokenizer::NextUnquoted | ( |  | ) |

Reads the next unquoted word from the input string.

Throws std::runtime_error on error.

Returns
  a pointer to the null-terminated word, or nullptr on end of line

## ◆ NextWord()

char* Tokenizer::NextWord | ( |  | ) |

Reads the next word.

Throws std::runtime_error on error.

Returns
  a pointer to the null-terminated word, or nullptr on end of line

## ◆ operator=()

Tokenizer& Tokenizer::operator= | ( | const Tokenizer & |  | ) |
| delete

## ◆ Rest()

char* Tokenizer::Rest | ( |  | ) |
| inline

Definition at line 46 of file Tokenizer.hxx.

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

- util/Tokenizer.hxx