Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef __LIBVISIO_UTILS_H__
00011 #define __LIBVISIO_UTILS_H__
00012
00013 #include <boost/shared_ptr.hpp>
00014
00015 #include "VSDTypes.h"
00016
00017 #ifdef _MSC_VER
00018
00019 typedef unsigned char uint8_t;
00020 typedef unsigned short uint16_t;
00021 typedef short int16_t;
00022 typedef unsigned uint32_t;
00023 typedef int int32_t;
00024 typedef unsigned __int64 uint64_t;
00025
00026 #else
00027
00028 #ifdef HAVE_CONFIG_H
00029
00030 #include <config.h>
00031
00032 #ifdef HAVE_STDINT_H
00033 #include <stdint.h>
00034 #endif
00035
00036 #ifdef HAVE_INTTYPES_H
00037 #include <inttypes.h>
00038 #endif
00039
00040 #else
00041
00042 #include <stdint.h>
00043 #include <inttypes.h>
00044
00045 #endif
00046
00047 #endif
00048
00049 #include <librevenge/librevenge.h>
00050 #include <librevenge-stream/librevenge-stream.h>
00051 #include <unicode/utypes.h>
00052
00053
00054
00055
00056
00057 #ifdef DEBUG
00058 #ifdef VERBOSE_DEBUG
00059 #define VSD_DEBUG_MSG(M) libvisio::debugPrint("%15s:%5d: ", __FILE__, __LINE__); libvisio::debugPrint M
00060 #define VSD_DEBUG(M) M
00061 #else
00062 #define VSD_DEBUG_MSG(M) libvisio::debugPrint M
00063 #define VSD_DEBUG(M) M
00064 #endif
00065 #else
00066 #define VSD_DEBUG_MSG(M)
00067 #define VSD_DEBUG(M)
00068 #endif
00069
00070 namespace libvisio
00071 {
00072
00073 typedef boost::shared_ptr<librevenge::RVNGInputStream> RVNGInputStreamPtr_t;
00074
00075 uint8_t readU8(librevenge::RVNGInputStream *input);
00076 uint16_t readU16(librevenge::RVNGInputStream *input);
00077 int16_t readS16(librevenge::RVNGInputStream *input);
00078 uint32_t readU32(librevenge::RVNGInputStream *input);
00079 int32_t readS32(librevenge::RVNGInputStream *input);
00080 uint64_t readU64(librevenge::RVNGInputStream *input);
00081
00082 double readDouble(librevenge::RVNGInputStream *input);
00083
00084 const librevenge::RVNGString getColourString(const Colour &c);
00085
00086 void appendUCS4(librevenge::RVNGString &text, UChar32 ucs4Character);
00087
00088 void debugPrint(const char *format, ...);
00089
00090 class EndOfStreamException
00091 {
00092 };
00093
00094 class XmlParserException
00095 {
00096 };
00097
00098 class GenericException
00099 {
00100 };
00101
00102 }
00103
00104 #endif // __LIBVISIO_UTILS_H__
00105