libvisio_utils.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /*
3  * This file is part of the libvisio project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  */
9 
10 #ifndef __LIBVISIO_UTILS_H__
11 #define __LIBVISIO_UTILS_H__
12 
13 #include "VSDTypes.h"
14 
15 #ifdef _MSC_VER
16 
17 typedef unsigned char uint8_t;
18 typedef unsigned short uint16_t;
19 typedef short int16_t;
20 typedef unsigned uint32_t;
21 typedef int int32_t;
22 typedef unsigned __int64 uint64_t;
23 
24 #else /* !defined _MSC_VER */
25 
26 #ifdef HAVE_CONFIG_H
27 
28 #include <config.h>
29 
30 #ifdef HAVE_STDINT_H
31 #include <stdint.h>
32 #endif
33 
34 #ifdef HAVE_INTTYPES_H
35 #include <inttypes.h>
36 #endif
37 
38 #else /* !defined HAVE_CONFIG_H */
39 
40 #include <stdint.h>
41 #include <inttypes.h>
42 
43 #endif /* HAVE_CONFIG_H */
44 
45 #endif /* _MSC_VER */
46 
47 #include <librevenge/librevenge.h>
48 #include <librevenge-stream/librevenge-stream.h>
49 #include <unicode/utypes.h>
50 
51 // debug message includes source file and line number
52 //#define VERBOSE_DEBUG 1
53 
54 // do nothing with debug messages in a release compile
55 #ifdef DEBUG
56 #ifdef VERBOSE_DEBUG
57 #define VSD_DEBUG_MSG(M) libvisio::debugPrint("%15s:%5d: ", __FILE__, __LINE__); libvisio::debugPrint M
58 #define VSD_DEBUG(M) M
59 #else
60 #define VSD_DEBUG_MSG(M) libvisio::debugPrint M
61 #define VSD_DEBUG(M) M
62 #endif
63 #else
64 #define VSD_DEBUG_MSG(M)
65 #define VSD_DEBUG(M)
66 #endif
67 
68 namespace libvisio
69 {
70 
71 uint8_t readU8(librevenge::RVNGInputStream *input);
72 uint16_t readU16(librevenge::RVNGInputStream *input);
73 int16_t readS16(librevenge::RVNGInputStream *input);
74 uint32_t readU32(librevenge::RVNGInputStream *input);
75 int32_t readS32(librevenge::RVNGInputStream *input);
76 uint64_t readU64(librevenge::RVNGInputStream *input);
77 
78 double readDouble(librevenge::RVNGInputStream *input);
79 
80 const librevenge::RVNGString getColourString(const Colour &c);
81 
82 void appendUCS4(librevenge::RVNGString &text, UChar32 ucs4Character);
83 
84 void debugPrint(const char *format, ...);
85 
87 {
88 };
89 
91 {
92 };
93 
95 {
96 };
97 
98 } // namespace libvisio
99 
100 #endif // __LIBVISIO_UTILS_H__
101 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
Definition: libvisio_utils.h:86
void appendUCS4(librevenge::RVNGString &text, UChar32 ucs4Character)
Definition: libvisio_utils.cpp:112
const librevenge::RVNGString getColourString(const Colour &c)
Definition: libvisio_utils.cpp:105
Definition: VSDTypes.h:72
int16_t readS16(librevenge::RVNGInputStream *input)
Definition: libvisio_utils.cpp:50
int32_t readS32(librevenge::RVNGInputStream *input)
Definition: libvisio_utils.cpp:71
double readDouble(librevenge::RVNGInputStream *input)
Definition: libvisio_utils.cpp:92
Definition: libvisio_utils.h:90
void debugPrint(const char *format,...)
Definition: libvisio_utils.cpp:127
Definition: libvisio_utils.h:68
Definition: libvisio_utils.h:94
uint32_t readU32(librevenge::RVNGInputStream *input)
Definition: libvisio_utils.cpp:55
uint8_t readU8(librevenge::RVNGInputStream *input)
Definition: libvisio_utils.cpp:18
uint16_t readU16(librevenge::RVNGInputStream *input)
Definition: libvisio_utils.cpp:34
uint64_t readU64(librevenge::RVNGInputStream *input)
Definition: libvisio_utils.cpp:76

Generated for libvisio by doxygen 1.8.9.1