string.h
Go to the documentation of this file.
1 #ifndef SOCKETCAN_INTERFACE_STRING_H
2 #define SOCKETCAN_INTERFACE_STRING_H
3 
4 #include "interface.h"
5 #include "filter.h"
6 #include <sstream>
7 
8 namespace can {
9 
10 bool hex2dec(uint8_t& d, const char& h);
11 
12 bool hex2buffer(std::string& out, const std::string& in_raw, bool pad);
13 
14 bool dec2hex(char& h, const uint8_t& d, bool lc);
15 
16 std::string byte2hex(const uint8_t& d, bool pad, bool lc);
17 
18 
19 std::string buffer2hex(const std::string& in, bool lc);
20 
21 std::string tostring(const Header& h, bool lc);
22 
23 Header toheader(const std::string& s);
24 
25 std::string tostring(const Frame& f, bool lc);
26 
27 Frame toframe(const std::string& s);
28 
29 template<class T> FrameFilterSharedPtr tofilter(const T &ct);
30 template<> FrameFilterSharedPtr tofilter(const std::string &s);
31 template<> FrameFilterSharedPtr tofilter(const uint32_t &id);
32 
33 FrameFilterSharedPtr tofilter(const char* s);
34 
35 template <typename T> FilteredFrameListener::FilterVector tofilters(const T& v) {
37  for(size_t i = 0; i < static_cast<size_t>(v.size()); ++i){
38  filters.push_back(tofilter(v[i]));
39  }
40  return filters;
41 }
42 
43 std::ostream& operator <<(std::ostream& stream, const Header& h);
44 std::ostream& operator <<(std::ostream& stream, const Frame& f);
45 
46 }
47 #endif
FilteredFrameListener::FilterVector tofilters(const T &v)
Definition: string.h:35
bool dec2hex(char &h, const uint8_t &d, bool lc)
Definition: string.cpp:38
std::string tostring(const Header &h, bool lc)
Definition: string.cpp:78
Definition: asio_base.h:11
FrameFilterSharedPtr tofilter(const T &ct)
bool hex2dec(uint8_t &d, const char &h)
Definition: string.cpp:6
Header toheader(const std::string &s)
Definition: string.cpp:103
std::string buffer2hex(const std::string &in, bool lc)
Definition: string.cpp:65
Frame toframe(const std::string &s)
Definition: string.cpp:119
std::ostream & operator<<(std::ostream &stream, const Header &h)
Definition: string.cpp:174
std::string byte2hex(const uint8_t &d, bool pad, bool lc)
Definition: string.cpp:52
std::vector< FrameFilterSharedPtr > FilterVector
Definition: filter.h:51
bool hex2buffer(std::string &out, const std::string &in_raw, bool pad)
Definition: string.cpp:19
std::shared_ptr< FrameFilter > FrameFilterSharedPtr
Definition: filter.h:15


socketcan_interface
Author(s): Mathias Lüdtke
autogenerated on Mon Feb 28 2022 23:28:00