10 #ifndef __LIBPAGEMAKER_UTILS_H__ 11 #define __LIBPAGEMAKER_UTILS_H__ 22 #include <boost/cstdint.hpp> 24 #include <librevenge-stream/librevenge-stream.h> 25 #include <librevenge/librevenge.h> 28 #define M_PI 3.14159265358979323846 31 #if defined(HAVE_FUNC_ATTRIBUTE_FORMAT) 32 # define PMD_ATTRIBUTE_PRINTF(fmt, arg) __attribute__((__format__(__printf__, fmt, arg))) 34 # define PMD_ATTRIBUTE_PRINTF(fmt, arg) 37 #if defined(HAVE_CLANG_ATTRIBUTE_FALLTHROUGH) 38 # define PMD_FALLTHROUGH [[clang::fallthrough]] 39 #elif defined(HAVE_GCC_ATTRIBUTE_FALLTHROUGH) 40 # define PMD_FALLTHROUGH __attribute__((fallthrough)) 42 # define PMD_FALLTHROUGH ((void) 0) 51 #define PMD_DEBUG_MSG(M) libpagemaker::debugPrint M 52 #define PMD_DEBUG(M) M 53 #define PMD_WARN_MSG(M) std::fprintf(stderr, "PageMaker [WARN] %15s:%d: ", __FILE__, __LINE__); std::fprintf(stderr, M) 54 #define PMD_ERR_MSG(M) std::fprintf(stderr, "PageMaker [ERROR] %15s:%d: ", __FILE__, __LINE__); std::fprintf(stderr, M) 56 #define PMD_DEBUG_MSG(M) 58 #define PMD_WARN_MSG(M) 59 #define PMD_ERR_MSG(M) 62 #define PMD_NUM_ELEMENTS(array) sizeof(array)/sizeof(array[0]) 74 uint8_t
readU8(
const RVNGInputStreamPtr &input,
bool =
false);
75 int8_t
readS8(
const RVNGInputStreamPtr &input,
bool =
false);
76 uint16_t
readU16(
const RVNGInputStreamPtr &input,
bool bigEndian=
false);
77 int16_t
readS16(
const RVNGInputStreamPtr &input,
bool bigEndian=
false);
78 uint32_t
readU32(
const RVNGInputStreamPtr &input,
bool bigEndian=
false);
79 int32_t
readS32(
const RVNGInputStreamPtr &input,
bool bigEndian=
false);
80 uint64_t
readU64(
const RVNGInputStreamPtr &input,
bool bigEndian=
false);
81 int64_t
readS64(
const RVNGInputStreamPtr &input,
bool bigEndian=
false);
83 const unsigned char *
readNBytes(
const RVNGInputStreamPtr &input,
unsigned long numBytes);
85 void skip(
const RVNGInputStreamPtr &input,
unsigned long numBytes);
87 void seek(
const RVNGInputStreamPtr &input,
unsigned long pos);
88 void seekRelative(
const RVNGInputStreamPtr &input,
long pos);
90 unsigned long getLength(
const RVNGInputStreamPtr &input);
108 #endif // __LIBPAGEMAKER_UTILS_H__ int8_t readS8(const RVNGInputStreamPtr &input, bool)
Definition: libpagemaker_utils.cpp:53
int64_t readS64(const RVNGInputStreamPtr &input, const bool bigEndian)
Definition: libpagemaker_utils.cpp:116
void skip(const RVNGInputStreamPtr &input, unsigned long numBytes)
Definition: libpagemaker_utils.cpp:134
unsigned long getLength(const RVNGInputStreamPtr &input)
Definition: libpagemaker_utils.cpp:159
int32_t readS32(const RVNGInputStreamPtr &input, const bool bigEndian)
Definition: libpagemaker_utils.cpp:95
uint8_t readU8(const RVNGInputStreamPtr &input, bool)
Definition: libpagemaker_utils.cpp:41
librevenge::RVNGInputStream * RVNGInputStreamPtr
Definition: libpagemaker_utils.h:67
void seek(const RVNGInputStreamPtr &input, const unsigned long pos)
Definition: libpagemaker_utils.cpp:141
Definition: libpagemaker_utils.h:102
Definition: libpagemaker_utils.h:97
Definition: libpagemaker_utils.h:92
#define PMD_ATTRIBUTE_PRINTF(fmt, arg)
Definition: libpagemaker_utils.h:34
Definition: libpagemaker_utils.h:69
int16_t readS16(const RVNGInputStreamPtr &input, const bool bigEndian)
Definition: libpagemaker_utils.cpp:74
virtual ~PMDStreamException()
Definition: libpagemaker_utils.h:94
void seekRelative(const RVNGInputStreamPtr &input, const long pos)
Definition: libpagemaker_utils.cpp:150
const unsigned char * readNBytes(const RVNGInputStreamPtr &input, const unsigned long numBytes)
Definition: libpagemaker_utils.cpp:121
Definition: geometry.h:22
uint16_t readU16(const RVNGInputStreamPtr &input, bool bigEndian)
Definition: libpagemaker_utils.cpp:58
uint64_t readU64(const RVNGInputStreamPtr &input, bool bigEndian)
Definition: libpagemaker_utils.cpp:100
void operator()(void *)
Definition: libpagemaker_utils.h:71
uint32_t readU32(const RVNGInputStreamPtr &input, bool bigEndian)
Definition: libpagemaker_utils.cpp:79