2000-09-18 15:18:56 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-11 10:53:21 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2005-09-29 12:03:19 +00:00
|
|
|
*
|
2010-02-12 15:01:35 +01:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2005-09-29 12:03:19 +00:00
|
|
|
*
|
2008-04-11 10:53:21 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-09-18 15:18:56 +00:00
|
|
|
*
|
2008-04-11 10:53:21 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2000-09-18 15:18:56 +00:00
|
|
|
*
|
2008-04-11 10:53:21 +00:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2000-09-18 15:18:56 +00:00
|
|
|
*
|
2008-04-11 10:53:21 +00:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2000-09-18 15:18:56 +00:00
|
|
|
*
|
2008-04-11 10:53:21 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2000-09-18 15:18:56 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
#ifndef _BUFFER_HXX
|
|
|
|
#define _BUFFER_HXX
|
|
|
|
|
|
|
|
#include <tools/solar.h>
|
|
|
|
#include <tools/string.hxx>
|
|
|
|
|
|
|
|
class SbiParser;
|
|
|
|
|
|
|
|
class SbiBuffer { // Code/Konstanten-Puffer:
|
|
|
|
SbiParser* pParser; // fuer Fehlermeldungen
|
|
|
|
char* pBuf; // Puffer-Pointer
|
|
|
|
char* pCur; // aktueller Puffer-Pointer
|
2006-11-01 15:15:15 +00:00
|
|
|
UINT32 nOff; // aktuelles Offset
|
|
|
|
UINT32 nSize; // aktuelle Groesse
|
2000-09-18 15:18:56 +00:00
|
|
|
short nInc; // Inkrement
|
|
|
|
BOOL Check( USHORT ); // Buffergroesse testen
|
|
|
|
public:
|
|
|
|
SbiBuffer( SbiParser*, short ); // Inkrement
|
|
|
|
~SbiBuffer();
|
2006-11-01 15:15:15 +00:00
|
|
|
void Patch( UINT32, UINT32 ); // Patchen
|
|
|
|
void Chain( UINT32 ); // Back-Chain
|
|
|
|
void Align( INT32 ); // Alignment
|
2000-09-18 15:18:56 +00:00
|
|
|
BOOL Add( const void*, USHORT );// Element anfuegen
|
|
|
|
BOOL operator += (const String&);// Basic-String speichern
|
|
|
|
BOOL operator += (INT8); // Zeichen speichern
|
|
|
|
BOOL operator += (INT16); // Integer speichern
|
|
|
|
BOOL operator += (UINT8); // Zeichen speichern
|
|
|
|
BOOL operator += (UINT16); // Integer speichern
|
2006-11-01 15:15:15 +00:00
|
|
|
BOOL operator += (UINT32); // Integer speichern
|
|
|
|
BOOL operator += (INT32); // Integer speichern
|
2000-09-18 15:18:56 +00:00
|
|
|
char* GetBuffer(); // Puffer rausgeben (selbst loeschen!)
|
2006-11-01 15:15:15 +00:00
|
|
|
char* GetBufferPtr(){ return pBuf; }
|
|
|
|
UINT32 GetSize() { return nOff; }
|
2000-09-18 15:18:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|