API Documentation
Loading...
Searching...
No Matches
Scanner Class Reference

Contains methods for easily reading objects in an ascii stream. More...

#include <Scanner.h>

Inheritance diagram for Scanner:
[legend]
Collaboration diagram for Scanner:
[legend]

Public Member Functions

StringcurrentLine ()
 
const StringcurrentLine () const
 
uint08 dataSize () const
 
File file () const
 
virtual uint01getByteArray ()
 
template<class t_type >
t_type getColumn (uint04 column)
 
const char * getCurrent () const
 
uint08 getCurrentFilePosition ()
 
uint08 getCurrentLineNumber () const
 
TranslatedString getDebugPosition () const
 
fltp04 getFilePercent ()
 
uint04 getLineLength () const
 
template<class t_type >
t_type getNext ()
 
void getNext (String &next)
 
template<class t_type >
t_type getNext (uint04 count)
 
template<class t_type >
t_type getNextHex ()
 
bool hasNext () const
 
bool isComment (char comment) const
 
uint04linePosition ()
 
void moveForward (uint04 distance=1)
 
virtual bool nextLine ()
 
virtual bool nextLine (String &string, bool clear_string=true)
 
char quoteCharacter () const
 
void resetLinePosition ()
 
 Scanner (const File &file, char delimiter='|', File::OpenMode mode=File::e_ascii_read)
 
 Scanner (const String &string, char delimiter='|')
 
void setDelimiter (char delimiter)
 
virtual void setFilePosition (uint08 file_position, bool read_line=true)
 
void setHasDelimiter (const bool has_delimiter)
 
void setIgnoreEmptyLines (bool ignore_new_lines)
 
void setIgnoreWhiteSpace (bool ignore_white_space)
 
void setQuoteCharacter (char quote_character)
 
uint04 skip ()
 
bool skipTo (char location, bool ignore_case=false)
 
bool skipTo (const Buffer< char > &locations, bool ignore_case=false)
 
bool skipTo (const char *location, bool ignore_case=false)
 
uint04 skipWhiteSpace ()
 
virtual ~Scanner ()
 

Protected Attributes

uint04 m_cur_column
 
uint04 m_cur_line_pos
 
uint08 m_current_file_position
 
String m_current_line
 
uint08 m_current_line_number
 
uint04 m_current_line_size
 
uint08 m_data_size
 
char m_delimiter
 
File m_file
 
bool m_has_delimiter
 
bool m_ignore_empty_lines
 
bool m_ignore_white_space = false
 
char m_quote_character
 
String m_time_format
 

Detailed Description

Contains methods for easily reading objects in an ascii stream.


using set deliminators and line logic.

Constructor & Destructor Documentation

◆ Scanner() [1/2]

Scanner ( const File & file,
char delimiter = '|',
File::OpenMode mode = File::e_ascii_read )
explicit

◆ Scanner() [2/2]

Scanner ( const String & string,
char delimiter = '|' )
explicit

◆ ~Scanner()

virtual ~Scanner ( )
virtual

Member Function Documentation

◆ currentLine() [1/2]

String & currentLine ( )
inline

◆ currentLine() [2/2]

const String & currentLine ( ) const
inline

◆ dataSize()

uint08 dataSize ( ) const

◆ file()

File file ( ) const
inline

◆ getByteArray()

virtual uint01 * getByteArray ( )
inlinevirtual

Reimplemented in BufferedScanner.

◆ getColumn()

template<class t_type >
t_type getColumn ( uint04 column)
inline

◆ getCurrent()

const char * getCurrent ( ) const

◆ getCurrentFilePosition()

uint08 getCurrentFilePosition ( )

◆ getCurrentLineNumber()

uint08 getCurrentLineNumber ( ) const

◆ getDebugPosition()

TranslatedString getDebugPosition ( ) const

◆ getFilePercent()

fltp04 getFilePercent ( )

◆ getLineLength()

uint04 getLineLength ( ) const

◆ getNext() [1/3]

template<class t_type >
t_type getNext ( )

◆ getNext() [2/3]

void getNext ( String & next)

◆ getNext() [3/3]

template<class t_type >
t_type getNext ( uint04 count)
inline

◆ getNextHex()

template<class t_type >
t_type getNextHex ( )

◆ hasNext()

bool hasNext ( ) const

◆ isComment()

bool isComment ( char comment) const

◆ linePosition()

uint04 & linePosition ( )
inline

◆ moveForward()

void moveForward ( uint04 distance = 1)

◆ nextLine() [1/2]

virtual bool nextLine ( )
virtual

Reimplemented in BufferedScanner.

◆ nextLine() [2/2]

virtual bool nextLine ( String & string,
bool clear_string = true )
virtual

Reimplemented in BufferedScanner.

◆ quoteCharacter()

char quoteCharacter ( ) const
inline

◆ resetLinePosition()

void resetLinePosition ( )

◆ setDelimiter()

void setDelimiter ( char delimiter)

◆ setFilePosition()

virtual void setFilePosition ( uint08 file_position,
bool read_line = true )
virtual

Reimplemented in BufferedScanner.

◆ setHasDelimiter()

void setHasDelimiter ( const bool has_delimiter)
inline

◆ setIgnoreEmptyLines()

void setIgnoreEmptyLines ( bool ignore_new_lines)
inline

◆ setIgnoreWhiteSpace()

void setIgnoreWhiteSpace ( bool ignore_white_space)
inline

◆ setQuoteCharacter()

void setQuoteCharacter ( char quote_character)
inline

◆ skip()

uint04 skip ( )

◆ skipTo() [1/3]

bool skipTo ( char location,
bool ignore_case = false )

◆ skipTo() [2/3]

bool skipTo ( const Buffer< char > & locations,
bool ignore_case = false )

◆ skipTo() [3/3]

bool skipTo ( const char * location,
bool ignore_case = false )

◆ skipWhiteSpace()

uint04 skipWhiteSpace ( )

Member Data Documentation

◆ m_cur_column

uint04 m_cur_column
protected

◆ m_cur_line_pos

uint04 m_cur_line_pos
protected

◆ m_current_file_position

uint08 m_current_file_position
protected

◆ m_current_line

String m_current_line
protected

◆ m_current_line_number

uint08 m_current_line_number
protected

◆ m_current_line_size

uint04 m_current_line_size
protected

◆ m_data_size

uint08 m_data_size
protected

◆ m_delimiter

char m_delimiter
protected

◆ m_file

File m_file
protected

◆ m_has_delimiter

bool m_has_delimiter
protected

◆ m_ignore_empty_lines

bool m_ignore_empty_lines
protected

◆ m_ignore_white_space

bool m_ignore_white_space = false
protected

◆ m_quote_character

char m_quote_character
protected

◆ m_time_format

String m_time_format
protected

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