NMEA: detectio of the optional tag block in front of a sentence, ignoring it for...
[marnav.git] / src / marnav / nmea / waypoint.hpp
blob1b41dcd21a06a6226c7b4891caf99525ef853d8a
1 #ifndef __MARNAV__NMEA__WAYPOINT__HPP__
2 #define __MARNAV__NMEA__WAYPOINT__HPP__
4 #include <string>
6 namespace marnav
8 namespace nmea
10 /// This represents a waypoint ID. They must be at least 1 character,
11 /// but can only be 8 long.
12 ///
13 class waypoint
15 public:
16 using value_type = std::string;
17 using size_type = value_type::size_type;
19 /// default constructed, invalid waypoint.
20 waypoint() {}
22 explicit waypoint(const std::string & id);
24 waypoint(const waypoint &) = default;
25 waypoint & operator=(const waypoint &) = default;
27 waypoint(waypoint &&) = default;
28 waypoint & operator=(waypoint &&) = default;
30 value_type get() const { return id_; }
31 operator value_type() const { return id_; }
33 const char * c_str() const { return id_.c_str(); }
35 size_type size() const { return id_.size(); }
36 bool empty() const { return id_.empty(); }
38 private:
39 value_type id_;
44 #endif