NMEA: detectio of the optional tag block in front of a sentence, ignoring it for...
[marnav.git] / src / marnav / nmea / detail.hpp
blob184af01640505de73303221e563a8c82d6d5e5e8
1 #ifndef __MARNAV__NMEA__DETAIL__HPP__
2 #define __MARNAV__NMEA__DETAIL__HPP__
4 #include <string>
5 #include <tuple>
6 #include <type_traits>
7 #include <vector>
8 #include <marnav/nmea/talker_id.hpp>
10 namespace marnav
12 namespace nmea
14 /// @cond DEV
15 class sentence; // forward declaration
17 namespace detail
19 std::tuple<talker, std::string> parse_address(
20 const std::string & address, bool ignore_unknown = false);
22 void ensure_checksum(
23 const std::string & s, const std::string & expected, std::string::size_type start_pos = 1u);
25 void check_raw_sentence(const std::string & s);
27 std::tuple<talker, std::string, std::vector<std::string>> extract_sentence_information(
28 const std::string & s, bool ignore_checksum = false);
30 /// Exists only to do SFINAE on the template parameter type `T`.
31 /// Since it does nothing, the compiler will optimize it out.
32 template <typename T,
33 typename std::enable_if<std::is_base_of<sentence, T>::value, int>::type = 0>
34 void create_sentence_base_class_check()
36 // intentionally left blank
39 /// @endcond
43 #endif