23 #ifndef NMEASentence20091211H 24 #define NMEASentence20091211H 31 #include <boost/algorithm/string.hpp> 32 #include <boost/foreach.hpp> 34 #include "goby/util/as.h" 58 NMEASentence(std::string s, strategy cs_strat = VALIDATE);
61 std::string message_no_cs()
const;
64 std::string message()
const;
67 std::string message_cr_nl()
const {
return message() +
"\r\n"; }
70 std::string talker_id()
const {
return empty() ?
"" : front().substr(1, 2); }
73 std::string sentence_id()
const {
return empty() ?
"" : front().substr(3); }
75 template <
typename T> T as(
int i)
const {
return goby::util::as<T>(at(i)); }
77 template <
typename T>
void push_back(T t) { push_back(goby::util::as<std::string>(t)); }
81 void push_back(
const std::string& str)
83 if (str.find(
',') == std::string::npos)
85 std::vector<std::string>::push_back(str);
90 std::vector<std::string> vec;
91 boost::split(vec, str, boost::is_any_of(
","));
93 BOOST_FOREACH (
const std::string& s, vec)
94 std::vector<std::string>::push_back(s);
98 static unsigned char checksum(
const std::string& s);
100 static bool enforce_talker_length;
108 out << nmea.message();
The global namespace for the Goby project.