Euphoria
eu::core::TextfileParser Struct Reference

Parses a text file in memory. More...

#include <textfileparser.h>

Public Member Functions

 TextfileParser (std::shared_ptr< detail::Textfile > afile)
 
char peek_char (int advance=0)
 advance = 0 - next char, 1-the one after that, negative values are not allowed More...
 
std::string peek_string (int advance=0)
 like PeekChar but returns human readable strings for some chars More...
 
bool expect_char (char c)
 if peekchar(0) is c then it is read and function returns true, otherwise false More...
 
void advance_char ()
 
char read_char ()
 
std::string read_ident ()
 
std::string read_string ()
 
std::string read_to_end_of_line ()
 
void skip_spaces (bool include_newline)
 
bool has_more () const
 
int get_line () const
 
int get_column () const
 

Static Public Member Functions

static TextfileParser from_string (const std::string &str)
 

Public Attributes

std::shared_ptr< detail::Textfilefile
 
detail::LocationInFile location = detail::LocationInFile{ 1, 1 }
 

Detailed Description

Parses a text file in memory.

Definition at line 41 of file textfileparser.h.

Constructor & Destructor Documentation

◆ TextfileParser()

eu::core::TextfileParser::TextfileParser ( std::shared_ptr< detail::Textfile afile)
explicit

Definition at line 90 of file textfileparser.cc.

Member Function Documentation

◆ advance_char()

void eu::core::TextfileParser::advance_char ( )

Definition at line 151 of file textfileparser.cc.

◆ expect_char()

bool eu::core::TextfileParser::expect_char ( char  c)

if peekchar(0) is c then it is read and function returns true, otherwise false

Definition at line 118 of file textfileparser.cc.

◆ from_string()

TextfileParser eu::core::TextfileParser::from_string ( const std::string &  str)
static

Definition at line 96 of file textfileparser.cc.

◆ get_column()

int eu::core::TextfileParser::get_column ( ) const

Definition at line 306 of file textfileparser.cc.

◆ get_line()

int eu::core::TextfileParser::get_line ( ) const

Definition at line 300 of file textfileparser.cc.

◆ has_more()

bool eu::core::TextfileParser::has_more ( ) const

Definition at line 294 of file textfileparser.cc.

◆ peek_char()

char eu::core::TextfileParser::peek_char ( int  advance = 0)

advance = 0 - next char, 1-the one after that, negative values are not allowed

Definition at line 102 of file textfileparser.cc.

◆ peek_string()

std::string eu::core::TextfileParser::peek_string ( int  advance = 0)

like PeekChar but returns human readable strings for some chars

Definition at line 109 of file textfileparser.cc.

◆ read_char()

char eu::core::TextfileParser::read_char ( )

Definition at line 133 of file textfileparser.cc.

◆ read_ident()

std::string eu::core::TextfileParser::read_ident ( )

Definition at line 189 of file textfileparser.cc.

◆ read_string()

std::string eu::core::TextfileParser::read_string ( )

Definition at line 202 of file textfileparser.cc.

◆ read_to_end_of_line()

std::string eu::core::TextfileParser::read_to_end_of_line ( )

Definition at line 252 of file textfileparser.cc.

◆ skip_spaces()

void eu::core::TextfileParser::skip_spaces ( bool  include_newline)

Definition at line 285 of file textfileparser.cc.

Member Data Documentation

◆ file

std::shared_ptr<detail::Textfile> eu::core::TextfileParser::file

Definition at line 43 of file textfileparser.h.

◆ location

detail::LocationInFile eu::core::TextfileParser::location = detail::LocationInFile{ 1, 1 }

Definition at line 44 of file textfileparser.h.


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