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
can::tofilters
FilteredFrameListener::FilterVector tofilters(const T &v)
Definition: string.h:35
filter.h
can::tostring
std::string tostring(const Header &h, bool lc)
Definition: string.cpp:78
can::tofilter
FrameFilterSharedPtr tofilter(const T &ct)
can::operator<<
std::ostream & operator<<(std::ostream &stream, const Header &h)
Definition: string.cpp:174
can::dec2hex
bool dec2hex(char &h, const uint8_t &d, bool lc)
Definition: string.cpp:38
can::byte2hex
std::string byte2hex(const uint8_t &d, bool pad, bool lc)
Definition: string.cpp:52
can::FilteredFrameListener::FilterVector
std::vector< FrameFilterSharedPtr > FilterVector
Definition: filter.h:51
can::buffer2hex
std::string buffer2hex(const std::string &in, bool lc)
Definition: string.cpp:65
interface.h
can::toheader
Header toheader(const std::string &s)
Definition: string.cpp:103
can
Definition: asio_base.h:11
can::FrameFilterSharedPtr
std::shared_ptr< FrameFilter > FrameFilterSharedPtr
Definition: filter.h:15
can::hex2dec
bool hex2dec(uint8_t &d, const char &h)
Definition: string.cpp:6
can::toframe
Frame toframe(const std::string &s)
Definition: string.cpp:119
can::hex2buffer
bool hex2buffer(std::string &out, const std::string &in_raw, bool pad)
Definition: string.cpp:19


socketcan_interface
Author(s): Mathias Lüdtke
autogenerated on Wed Mar 2 2022 00:52:25