1 #ifndef _ots_BinaryStringMacros_h_
2 #define _ots_BinaryStringMacros_h_
4 #include "otsdaq/Macros/CoutMacros.h"
5 #include "otsdaq/Macros/StringMacros.h"
31 static std::string binaryStringToHexString (
32 const void* binaryBuffer,
33 unsigned int numberOfBytes,
34 const std::string& resultPreamble =
"",
35 const std::string& resultDelimiter =
"");
38 static std::string binaryNumberToHexString (
39 const T& binaryBuffer,
40 const std::string& resultPreamble =
"0x",
41 const std::string& resultDelimiter =
" ");
42 static std::string binaryNumberToHexString (
43 const std::string& binaryBuffer,
44 const std::string& resultPreamble =
"0x",
45 const std::string& resultDelimiter =
" ");
46 static std::string binaryNumberToHexString (
47 const void* binaryBuffer,
48 unsigned int numberOfBytes,
49 const std::string& resultPreamble =
"0x",
50 const std::string& resultDelimiter =
" ");
55 static void insertValueInBinaryString (
56 std::string& binaryBuffer,
58 unsigned int bitIndex = 0);
61 static void insertValueInBinaryString (
62 std::string& binaryBuffer,
63 const std::string& value,
64 unsigned int bitIndex = 0);
68 static void extractValueFromBinaryString(
69 const std::string& binaryBuffer,
71 unsigned int bitIndex = 0);
74 static void extractValueFromBinaryString(
75 const std::string& binaryBuffer,
77 unsigned int valueNumberOfBits,
78 unsigned int bitIndex = 0);
81 static void extractValueFromBinaryString(
82 const void* binaryBuffer,
83 unsigned int bufferNumberOfBytes,
85 unsigned int valueNumberOfBits,
86 unsigned int bitIndex = 0);
90 #include "otsdaq/Macros/BinaryStringMacros.icc"