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 }
44 
45 std::ostream& operator <<(std::ostream& stream, const can::Header& h);
46 std::ostream& operator <<(std::ostream& stream, const can::Frame& f);
47 
48 #endif
FilteredFrameListener::FilterVector tofilters(const T &v)
Definition: string.h:35
bool dec2hex(char &h, const uint8_t &d, bool lc)
Definition: string.cpp:37
std::string tostring(const Header &h, bool lc)
Definition: string.cpp:77
Definition: asio_base.h:11
FrameFilterSharedPtr tofilter(const T &ct)
bool hex2dec(uint8_t &d, const char &h)
Definition: string.cpp:5
Header toheader(const std::string &s)
Definition: string.cpp:99
std::string buffer2hex(const std::string &in, bool lc)
Definition: string.cpp:64
Frame toframe(const std::string &s)
Definition: string.cpp:114
std::vector< FrameFilterSharedPtr > FilterVector
Definition: filter.h:49
std::string byte2hex(const uint8_t &d, bool pad, bool lc)
Definition: string.cpp:51
std::ostream & operator<<(std::ostream &stream, const can::Header &h)
Definition: string.cpp:171
boost::shared_ptr< FrameFilter > FrameFilterSharedPtr
Definition: filter.h:15
bool hex2buffer(std::string &out, const std::string &in_raw, bool pad)
Definition: string.cpp:18


socketcan_interface
Author(s): Mathias Lüdtke
autogenerated on Fri May 14 2021 02:59:39