DUNE: Uniform Navigational Environment  2022.04.0
DUNE::Parsers::NMEASentence Class Reference

Detailed Description

NMEA Sentence reader is a simple NMEA parser capable of validating and converting sentence fields.

Public Member Functions

 NMEASentence (char start_sym='$')
 
const std::string & getCode () const
 
void setCode (const std::string &code)
 
const std::string & getField (size_t index) const
 
void setField (size_t index, const std::string &value)
 
void setField (size_t index, const char *fmt,...)
 
size_t getFieldCount () const
 
std::string str () const
 
void clear ()
 
void parse (const std::string &text)
 

Constructor & Destructor Documentation

◆ NMEASentence()

DUNE::Parsers::NMEASentence::NMEASentence ( char  start_sym = '$')
inlineexplicit

References clear().

Member Function Documentation

◆ clear()

void DUNE::Parsers::NMEASentence::clear ( void  )
inline

Clear sentence.

Referenced by NMEASentence().

◆ getCode()

const std::string& DUNE::Parsers::NMEASentence::getCode ( ) const
inline

◆ getField()

const std::string& DUNE::Parsers::NMEASentence::getField ( size_t  index) const
inline

◆ getFieldCount()

size_t DUNE::Parsers::NMEASentence::getFieldCount ( ) const
inline

Retrieve the number of fields currently present in the sentence.

Returns
number of fields.

◆ parse()

void DUNE::Parsers::NMEASentence::parse ( const std::string &  text)
inline

Parse NMEA sentence.

Parameters
[in]textstring with NMEA sentence.

References DUNE::Algorithms::XORChecksum::compute(), DUNE::Utils::String::split(), and DUNE::Utils::String::trim().

◆ setCode()

void DUNE::Parsers::NMEASentence::setCode ( const std::string &  code)
inline

◆ setField() [1/2]

void DUNE::Parsers::NMEASentence::setField ( size_t  index,
const std::string &  value 
)
inline

Referenced by setField().

◆ setField() [2/2]

void DUNE::Parsers::NMEASentence::setField ( size_t  index,
const char *  fmt,
  ... 
)
inline

◆ str()

std::string DUNE::Parsers::NMEASentence::str ( void  ) const
inline
Collaboration diagram for DUNE::Parsers::NMEASentence:
Collaboration graph