Go to the documentation of this file.
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;
97 for (
const std::string& s : vec) std::vector<std::string>::push_back(s);
101 static unsigned char checksum(
const std::string& s);
std::string sentence_id() const
The global namespace for the Goby project.
static unsigned char checksum(const std::string &s)
std::string talker_id() const
std::string message_cr_nl() const
std::string str(TimeType value=SystemClock::now< TimeType >())
Returns the provided time (or current time if omitted) as a human-readable string.
bad_nmea_sentence(const std::string &s)
void push_back(const std::string &str)
std::string message_no_cs() const
void split(const char *b, const char *e, char d, std::function< void(const char *, const char *)> fn)
static bool enforce_talker_length
std::string message() const
std::ostream & operator<<(std::ostream &out, const goby::util::NMEASentence &nmea)