22 #ifndef NDN_COMMON_HPP
23 #define NDN_COMMON_HPP
34 #if NDN_CPP_HAVE_STD_SHARED_PTR && NDN_CPP_WITH_STD_SHARED_PTR
36 namespace ndn {
namespace ptr_lib = std; }
37 #elif NDN_CPP_HAVE_BOOST_SHARED_PTR && NDN_CPP_WITH_BOOST_SHARED_PTR
38 #include <boost/shared_ptr.hpp>
39 #include <boost/weak_ptr.hpp>
40 #include <boost/make_shared.hpp>
41 #include <boost/enable_shared_from_this.hpp>
42 namespace ndn {
namespace ptr_lib = boost; }
65 #include <ndnboost/shared_ptr.hpp>
66 #include <ndnboost/weak_ptr.hpp>
67 #include <ndnboost/make_shared.hpp>
68 #include <ndnboost/enable_shared_from_this.hpp>
69 namespace ndn {
namespace ptr_lib = ndnboost; }
75 #if NDN_CPP_HAVE_STD_FUNCTION && NDN_CPP_WITH_STD_FUNCTION
78 namespace ndn {
namespace func_lib {
84 using std::placeholders::_1;
85 using std::placeholders::_2;
86 using std::placeholders::_3;
87 using std::placeholders::_4;
88 using std::placeholders::_5;
89 using std::placeholders::_6;
90 using std::placeholders::_7;
91 using std::placeholders::_8;
92 using std::placeholders::_9;
96 namespace placeholders {}
98 #elif NDN_CPP_HAVE_BOOST_FUNCTION && NDN_CPP_WITH_BOOST_FUNCTION
99 #include <boost/function.hpp>
100 #include <boost/bind.hpp>
101 namespace ndn {
namespace func_lib = boost; }
104 #include <ndnboost/function.hpp>
105 #include <ndnboost/bind.hpp>
106 namespace ndn {
namespace func_lib = ndnboost; }
128 toHex(
const uint8_t* array,
size_t arrayLength, std::ostringstream& result);
136 toHex(
const std::vector<uint8_t>& array, std::ostringstream& result)
138 return toHex(&array[0], array.size(), result);
148 toHex(
const uint8_t* array,
size_t arrayLength);
155 static __inline std::string
156 toHex(
const std::vector<uint8_t>& array)
158 return toHex(&array[0], array.size());
double Milliseconds
A time interval represented as the number of milliseconds.
Definition: common.hpp:114
void ndn_trim(std::string &str)
Modify str in place to erase whitespace on the left and right.
double MillisecondsSince1970
The calendar time represented as the number of milliseconds since 1/1/1970.
Definition: common.hpp:119
bool equalsIgnoreCase(const std::string &s1, const std::string &s2)
Compare the strings for equality, ignoring case.
void toHex(const uint8_t *array, size_t arrayLength, std::ostringstream &result)
Write the hex representation of the bytes in array to the result.
Definition: common.cpp:32