irccd  3.0.3
Public Types | Public Member Functions | List of all members
irccd::ini::token Class Reference

Describe a token read in the .ini source. More...

#include <ini.hpp>

Public Types

enum  type {
  include , tryinclude , section , word ,
  quoted_word , assign , list_begin , list_end ,
  comma
}
 token type. More...
 

Public Member Functions

 token (type type, unsigned line, unsigned column, std::string value="") noexcept
 
auto get_type () const noexcept -> type
 
auto get_line () const noexcept -> unsigned
 
auto get_column () const noexcept -> unsigned
 
auto get_value () const noexcept -> const std::string &
 

Detailed Description

Describe a token read in the .ini source.

This class can be used when you want to parse a .ini file yourself.

See also
analyse

Member Enumeration Documentation

◆ type

token type.

Enumerator
include 

include statement

tryinclude 

tryinclude statement

section 

[section]

word 

word without quotes

quoted_word 

word with quotes

assign 

= assignment

list_begin 

begin of list (

list_end 

end of list )

comma 

list separation

Constructor & Destructor Documentation

◆ token()

irccd::ini::token::token ( type  type,
unsigned  line,
unsigned  column,
std::string  value = "" 
)
noexcept

Construct a token.

Parameters
typethe type
linethe line
columnthe column
valuethe value

Member Function Documentation

◆ get_column()

auto irccd::ini::token::get_column ( ) const -> unsigned
noexcept

Get the column.

Returns
the column

◆ get_line()

auto irccd::ini::token::get_line ( ) const -> unsigned
noexcept

Get the line.

Returns
the line

◆ get_type()

auto irccd::ini::token::get_type ( ) const -> type
noexcept

Get the type.

Returns
the type

◆ get_value()

auto irccd::ini::token::get_value ( ) const -> const std::string &
noexcept

Get the value. For words, quoted words and section, the value is the content. Otherwise it's the characters parsed.

Returns
the value

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