CoastalME (Coastal Modelling Environment)
Simulates the long-term behaviour of complex coastlines
Loading...
Searching...
No Matches
CYamlParser Class Reference

Simple YAML parser class. More...

#include <yaml_parser.h>

Public Member Functions

 CYamlParser ()
 
 ~CYamlParser ()
 
bool bParseFile (string const &strFileName)
 
CYamlNode GetRoot () const
 
string GetError () const
 
bool bHasError () const
 

Private Member Functions

int nGetIndentLevel (string const &strLine) const
 
string strTrimLeft (string const &strLine) const
 
string strTrimRight (string const &strLine) const
 
string strTrim (string const &strLine) const
 
bool bIsComment (string const &strLine) const
 
bool bIsEmpty (string const &strLine) const
 
bool bParseLine (string const &strLine, string &strKey, string &strValue, bool &bIsSequence) const
 
string strRemoveQuotes (string const &strValue) const
 
CYamlNode ParseSection (ifstream &fileStream, int nBaseIndent)
 

Private Attributes

CYamlNode m_RootNode
 
string m_strFileName
 
int m_nCurrentLine
 
string m_strError
 

Detailed Description

Simple YAML parser class.

Definition at line 69 of file yaml_parser.h.

Constructor & Destructor Documentation

◆ CYamlParser()

CYamlParser::CYamlParser ( )

Definition at line 155 of file yaml_parser.cpp.

◆ ~CYamlParser()

CYamlParser::~CYamlParser ( )

Definition at line 159 of file yaml_parser.cpp.

Member Function Documentation

◆ bHasError()

bool CYamlParser::bHasError ( ) const

Definition at line 200 of file yaml_parser.cpp.

◆ bIsComment()

bool CYamlParser::bIsComment ( string const & strLine) const
private

Definition at line 241 of file yaml_parser.cpp.

Referenced by ParseSection().

◆ bIsEmpty()

bool CYamlParser::bIsEmpty ( string const & strLine) const
private

Definition at line 247 of file yaml_parser.cpp.

Referenced by ParseSection().

◆ bParseFile()

bool CYamlParser::bParseFile ( string const & strFileName)

Definition at line 163 of file yaml_parser.cpp.

Referenced by CSimulation::bConfigureFromYamlFile().

◆ bParseLine()

bool CYamlParser::bParseLine ( string const & strLine,
string & strKey,
string & strValue,
bool & bIsSequence ) const
private

Definition at line 252 of file yaml_parser.cpp.

Referenced by ParseSection().

◆ GetError()

string CYamlParser::GetError ( ) const

Definition at line 195 of file yaml_parser.cpp.

Referenced by CSimulation::bConfigureFromYamlFile().

◆ GetRoot()

CYamlNode CYamlParser::GetRoot ( ) const

Definition at line 190 of file yaml_parser.cpp.

Referenced by CSimulation::bConfigureFromYamlFile().

◆ nGetIndentLevel()

int CYamlParser::nGetIndentLevel ( string const & strLine) const
private

Definition at line 205 of file yaml_parser.cpp.

Referenced by ParseSection().

◆ ParseSection()

CYamlNode CYamlParser::ParseSection ( ifstream & fileStream,
int nBaseIndent )
private

Definition at line 302 of file yaml_parser.cpp.

Referenced by bParseFile(), and ParseSection().

◆ strRemoveQuotes()

string CYamlParser::strRemoveQuotes ( string const & strValue) const
private

Definition at line 284 of file yaml_parser.cpp.

Referenced by bParseLine().

◆ strTrim()

string CYamlParser::strTrim ( string const & strLine) const
private

Definition at line 236 of file yaml_parser.cpp.

Referenced by bIsEmpty(), and bParseLine().

◆ strTrimLeft()

string CYamlParser::strTrimLeft ( string const & strLine) const
private

Definition at line 220 of file yaml_parser.cpp.

Referenced by bIsComment(), bParseLine(), and strTrim().

◆ strTrimRight()

string CYamlParser::strTrimRight ( string const & strLine) const
private

Definition at line 228 of file yaml_parser.cpp.

Referenced by strTrim().

Field Documentation

◆ m_nCurrentLine

int CYamlParser::m_nCurrentLine
private

Definition at line 74 of file yaml_parser.h.

Referenced by bParseFile(), CYamlParser(), and ParseSection().

◆ m_RootNode

CYamlNode CYamlParser::m_RootNode
private

Definition at line 72 of file yaml_parser.h.

Referenced by bParseFile(), and GetRoot().

◆ m_strError

string CYamlParser::m_strError
private

Definition at line 75 of file yaml_parser.h.

Referenced by bHasError(), bParseFile(), and GetError().

◆ m_strFileName

string CYamlParser::m_strFileName
private

Definition at line 73 of file yaml_parser.h.

Referenced by bParseFile().


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