libvisio_utils.h Source File documentation

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

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
86 class EndOfStreamException
87 {
88 };
89
90 class XmlParserException
91 {
92 };
93
94 class GenericException
95 {
96 };
97
98 } // namespace libvisio
99
100 #endif // __LIBVISIO_UTILS_H__
101 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libvisio::EndOfStreamException
Definition: libvisio_utils.h:86
libvisio::appendUCS4
void appendUCS4(librevenge::RVNGString &text, UChar32 ucs4Character)
Definition: libvisio_utils.cpp:112
libvisio::getColourString
const librevenge::RVNGString getColourString(const Colour &c)
Definition: libvisio_utils.cpp:105
libvisio::Colour
Definition: VSDTypes.h:72
libvisio::readS16
int16_t readS16(librevenge::RVNGInputStream *input)
Definition: libvisio_utils.cpp:50
libvisio::readS32
int32_t readS32(librevenge::RVNGInputStream *input)
Definition: libvisio_utils.cpp:71
libvisio::readDouble
double readDouble(librevenge::RVNGInputStream *input)
Definition: libvisio_utils.cpp:92
VSDTypes.h
libvisio::XmlParserException
Definition: libvisio_utils.h:90
libvisio::debugPrint
void debugPrint(const char *format,...)
Definition: libvisio_utils.cpp:127
libvisio
Definition: libvisio_utils.h:68
libvisio::GenericException
Definition: libvisio_utils.h:94
libvisio::readU32
uint32_t readU32(librevenge::RVNGInputStream *input)
Definition: libvisio_utils.cpp:55
libvisio::readU8
uint8_t readU8(librevenge::RVNGInputStream *input)
Definition: libvisio_utils.cpp:18
libvisio::readU16
uint16_t readU16(librevenge::RVNGInputStream *input)
Definition: libvisio_utils.cpp:34
libvisio::readU64
uint64_t readU64(librevenge::RVNGInputStream *input)
Definition: libvisio_utils.cpp:76