extern "C++" { namespace std { class exception { public: exception() throw() { } }; } } typedef unsigned int size_t; extern "C" { } typedef unsigned char UCHAR; typedef unsigned short USHORT; typedef char TEXT; namespace Firebird { class status_exception : public std::exception { }; class fatal_exception : public status_exception { union { } __value; } _IO_cookie_io_functions_t; void gds__log(const TEXT*, ...); struct MemoryBlock { union { class MemoryPool* mbk_pool; }; }; class PermanentStorage { private: MemoryPool& pool; protected: explicit PermanentStorage(MemoryPool& p) : pool(p) { } }; class AutoStorage : public PermanentStorage { public: static MemoryPool& getAutoMemoryPool(); protected: AutoStorage() : PermanentStorage(getAutoMemoryPool()) { } }; class AbstractString : private AutoStorage { public: typedef char char_type; typedef const char* const_pointer; enum { INLINE_BUFFER_SIZE = 32, INIT_RESERVE = 16 }; protected: typedef USHORT internal_size_type; char_type inlineBuffer[INLINE_BUFFER_SIZE]; char_type* stringBuffer; internal_size_type stringLength, bufferSize; inline AbstractString() : stringBuffer(inlineBuffer), stringLength(0), bufferSize(INLINE_BUFFER_SIZE) { } public: inline const_pointer c_str() const { } }; class StringComparator { }; template class StringBase : public AbstractString { typedef StringBase StringType; inline StringType& append(const StringType& str) { { }; } }; typedef StringBase string; class ClumpletReader : protected AutoStorage { public: enum Kind { Tagged, UnTagged, SpbAttach, SpbStart, Tpb }; ClumpletReader(Kind k, const UCHAR* buffer, size_t buffLen); bool isEof() const { } void moveNext(); void rewind(); UCHAR getClumpTag() const; size_t getClumpLength() const; const UCHAR* getBytes() const; size_t getBufferLength() const { size_t rc = getBufferEnd() - getBuffer(); if (rc == 1 && kind != UnTagged && kind != SpbStart) { } } size_t getCurOffset() const { } void dump() const; const Kind kind; virtual const UCHAR* getBuffer() const { } virtual const UCHAR* getBufferEnd() const { } }; void ClumpletReader::dump() const { class ClumpletDump : public ClumpletReader { public: ClumpletDump(Kind k, const UCHAR* buffer, size_t buffLen) : ClumpletReader(k, buffer, buffLen) { } static string hexString(const UCHAR* b, size_t len) { for (; len > 0; --len, ++b) { } } }; try { ClumpletDump d(kind, getBuffer(), getBufferLength()); for (d.rewind(); !(d.isEof()); d.moveNext()) { gds__log("Clump %d at offset %d: %s", d.getClumpTag(), d.getCurOffset(), ClumpletDump::hexString(d.getBytes(), d.getClumpLength()).c_str()); } } catch(const fatal_exception& x) { } } }