8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-31 00:43:02 +01:00
firebird-mirror/src/jrd/sqz.h

70 lines
1.8 KiB
C
Raw Normal View History

2001-05-23 15:26:42 +02:00
/*
* PROGRAM: JRD Access Method
* MODULE: sqz.h
* DESCRIPTION: Data compression control block
*
* The contents of this file are subject to the Interbase Public
* License Version 1.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy
* of the License at http://www.Inprise.com/IPL.html
*
* Software distributed under the License is distributed on an
* "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
* or implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code was created by Inprise Corporation
* and its predecessors. Portions created by Inprise Corporation are
* Copyright (C) Inprise Corporation.
*
* All Rights Reserved.
* Contributor(s): ______________________________________.
*/
#ifndef JRD_SQZ_H
#define JRD_SQZ_H
2001-05-23 15:26:42 +02:00
2001-12-24 03:51:06 +01:00
#include "../include/fb_blk.h"
#include "../../common/classes/array.h"
2001-12-24 03:51:06 +01:00
namespace Jrd
{
class Compressor
{
public:
2014-07-17 20:48:46 +02:00
Compressor(MemoryPool& pool, FB_SIZE_T length, const UCHAR* data);
2014-07-17 20:48:46 +02:00
FB_SIZE_T getPackedLength() const
{
return m_length;
}
const UCHAR* getControl() const
{
return m_control.begin();
}
2014-07-17 20:48:46 +02:00
FB_SIZE_T getControlSize() const
{
return m_control.getCount();
}
void pack(const UCHAR*, UCHAR*) const;
2014-07-17 20:48:46 +02:00
FB_SIZE_T pack(const UCHAR*, FB_SIZE_T, UCHAR*) const;
FB_SIZE_T getPartialLength(FB_SIZE_T, const UCHAR*) const;
2014-07-17 20:48:46 +02:00
static UCHAR* unpack(FB_SIZE_T, const UCHAR*, FB_SIZE_T, UCHAR*);
static FB_SIZE_T applyDiff(FB_SIZE_T, const UCHAR*, FB_SIZE_T, UCHAR* const);
static FB_SIZE_T makeDiff(FB_SIZE_T, const UCHAR*, FB_SIZE_T, UCHAR*, FB_SIZE_T, UCHAR*);
static FB_SIZE_T makeNoDiff(FB_SIZE_T, UCHAR*);
private:
Firebird::HalfStaticArray<UCHAR, 2048> m_control;
2014-07-17 20:48:46 +02:00
FB_SIZE_T m_length;
};
2001-05-23 15:26:42 +02:00
} //namespace Jrd
#endif // JRD_SQZ_H
2003-12-31 06:36:12 +01:00