15 #if defined(__MINGW32__)
16 #define ATTRIBUTE_FORMAT_PRINTF __attribute__((format(__MINGW_PRINTF_FORMAT, 1, 2)))
17 #elif defined(__GNUC__)
18 #define ATTRIBUTE_FORMAT_PRINTF __attribute__((format(printf, 1, 2)))
20 #define ATTRIBUTE_FORMAT_PRINTF
32 std::string
stringFormat(
const char* format, ...) ATTRIBUTE_FORMAT_PRINTF;
51 std::ostream& operator<<(
std::ostream& stream, const binaryToStringHelper<T>& binToStr) {
52 for (
size_t i = 0; i < binToStr.buf_.size(); ++i) {
53 auto c =
static_cast<int>(binToStr.buf_.at(i));
54 const bool bTrailingNull = c == 0 && i == binToStr.buf_.size() - 1;
56 if (c < ' ' || c >= 127) {
59 stream.put(static_cast<char>(c));
103 std::string
indent(
size_t i);
107 #endif // #ifndef IMAGE_INT_HPP_
std::string stringFormat(const char *format,...)
format a string in the pattern of sprintf .
Definition: image_int.cpp:12
std::string indent(size_t i)
indent output for kpsRecursive in printStructure() .
Definition: image_int.cpp:38
Helper structure for the Matroska tags lookup table.
Definition: matroskavideo.hpp:39
constexpr binaryToStringHelper< T > binaryToString(Slice< T > &&sl) noexcept
format binary data for display in Image::printStructure()
Definition: image_int.hpp:98
Helper struct for binary data output via binaryToString.
Definition: image_int.hpp:42