25#ifndef GOBY_UTIL_LINEBASEDCOMMS_NMEA_SENTENCE_H
26#define GOBY_UTIL_LINEBASEDCOMMS_NMEA_SENTENCE_H
35#include <boost/algorithm/string/classification.hpp>
36#include <boost/algorithm/string/split.hpp>
74 std::string
talker_id()
const {
return empty() ?
"" : front().substr(1, 2); }
77 std::string
sentence_id()
const {
return empty() ?
"" : front().substr(3); }
79 template <
typename T> T
as(
int i)
const {
return goby::util::as<T>(at(i)); }
87 if (str.find(
',') == std::string::npos)
89 std::vector<std::string>::push_back(str);
94 std::vector<std::string> vec;
95 boost::split(vec, str, boost::is_any_of(
","));
97 for (
const std::string& s : vec) std::vector<std::string>::push_back(s);
101 static unsigned char checksum(
const std::string& s);
NMEASentence(std::string s, strategy cs_strat=VALIDATE)
std::string message() const
static unsigned char checksum(const std::string &s)
std::string sentence_id() const
std::string message_cr_nl() const
static bool enforce_talker_length
std::string talker_id() const
std::string message_no_cs() const
void push_back(const std::string &str)
bad_nmea_sentence(const std::string &s)
The global namespace for the Goby project.