- 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 <boost/shared_ptr.hpp>
14
15 #include "VSDTypes.h"
16
17 #ifdef _MSC_VER
18
19 typedef unsigned char uint8_t;
20 typedef unsigned short uint16_t;
21 typedef short int16_t;
22 typedef unsigned uint32_t;
23 typedef int int32_t;
24 typedef unsigned __int64 uint64_t;
25
26 #else /* !defined _MSC_VER */
27
28 #ifdef HAVE_CONFIG_H
29
30 #include <config.h>
31
32 #ifdef HAVE_STDINT_H
33 #include <stdint.h>
34 #endif
35
36 #ifdef HAVE_INTTYPES_H
37 #include <inttypes.h>
38 #endif
39
40 #else /* !defined HAVE_CONFIG_H */
41
42 #include <stdint.h>
43 #include <inttypes.h>
44
45 #endif /* HAVE_CONFIG_H */
46
47 #endif /* _MSC_VER */
48
49 #include <librevenge/librevenge.h>
50 #include <librevenge-stream/librevenge-stream.h>
51 #include <unicode/utypes.h>
52
53 // debug message includes source file and line number
54 //#define VERBOSE_DEBUG 1
55
56 // do nothing with debug messages in a release compile
57 #ifdef DEBUG
58 #ifdef VERBOSE_DEBUG
59 #define VSD_DEBUG_MSG(M) libvisio::debugPrint("%15s:%5d: ", __FILE__, __LINE__); libvisio::debugPrint M
60 #define VSD_DEBUG(M) M
61 #else
62 #define VSD_DEBUG_MSG(M) libvisio::debugPrint M
63 #define VSD_DEBUG(M) M
64 #endif
65 #else
66 #define VSD_DEBUG_MSG(M)
67 #define VSD_DEBUG(M)
68 #endif
69
70 namespace libvisio
71 {
72
73 typedef boost::shared_ptr<librevenge::RVNGInputStream> RVNGInputStreamPtr_t;
74
75 uint8_t readU8(librevenge::RVNGInputStream *input);
76 uint16_t readU16(librevenge::RVNGInputStream *input);
77 int16_t readS16(librevenge::RVNGInputStream *input);
78 uint32_t readU32(librevenge::RVNGInputStream *input);
79 int32_t readS32(librevenge::RVNGInputStream *input);
80 uint64_t readU64(librevenge::RVNGInputStream *input);
81
82 double readDouble(librevenge::RVNGInputStream *input);
83
84 const librevenge::RVNGString getColourString(const Colour &c);
85
86 void appendUCS4(librevenge::RVNGString &text, UChar32 ucs4Character);
87
88 void debugPrint(const char *format, ...);
89
90 class EndOfStreamException
91 {
92 };
93
94 class XmlParserException
95 {
96 };
97
98 class GenericException
99 {
100 };
101
102 } // namespace libvisio
103
104 #endif // __LIBVISIO_UTILS_H__
105 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libvisio::EndOfStreamException
Definition: libvisio_utils.h:90
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::RVNGInputStreamPtr_t
boost::shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr_t
Definition: libvisio_utils.h:73
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:94
libvisio::debugPrint
void debugPrint(const char *format,...)
Definition: libvisio_utils.cpp:127
libvisio
Definition: libvisio_utils.h:70
libvisio::GenericException
Definition: libvisio_utils.h:98
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