Update contrib.
1 // Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #if !defined(__S32HUF_H__)
18 #if !defined(__S32BUF_H__)
21 #if !defined(__S32STRM_H__)
25 class Huffman // Huffman primitives: sell to base
28 IMPORT_C static const TUint* DefaultBits(); // long code needs to be sorted out
29 IMPORT_C static const TUint8* DefaultTree(); // is there a real case for default tables?
31 IMPORT_C void Encode(...); // incremental encoding and decoding primitives
32 IMPORT_C void Decode(...); // suitable for sharing between descriptors and filters
35 class THufEncodeFilter : public TStreamFilter
38 IMPORT_C THufEncodeFilter();
39 IMPORT_C void Set(MStreamBuf* aHost,const TUint* aHufBits,TInt aMode=EWrite);
41 IMPORT_C TInt Capacity(TInt aMaxLength);
42 IMPORT_C TInt FilterL(TAny* aPtr,TInt aMaxLength,const TUint8*& aFrom,const TUint8* anEnd);
43 IMPORT_C void DoSynchL();
50 class THufDecodeFilter : public TStreamFilter
53 IMPORT_C THufDecodeFilter();
54 IMPORT_C void Set(MStreamBuf* aHost,const TUint8* aHufTree,TInt aMode=ERead);
56 IMPORT_C TInt Capacity(TInt aMaxLength);
57 IMPORT_C TInt FilterL(TAny* aPtr,TInt aMaxLength,const TUint8*& aFrom,const TUint8* anEnd);
58 IMPORT_C void DoSynchL();
65 class RHufDecodeReadStream : public RReadStream
68 RHufDecodeReadStream() {}
69 IMPORT_C RHufDecodeReadStream(RReadStream& aHost,const TUint8* aHufTree=Huffman::DefaultTree());
70 IMPORT_C void Open(RReadStream& aHost,const TUint8* aHufTree=Huffman::DefaultTree());
72 THufDecodeFilter iFilter;
74 class RHufEncodeWriteStream : public RWriteStream
77 RHufEncodeWriteStream() {}
78 inline RHufEncodeWriteStream(const MExternalizer<TStreamRef>& anExter);
79 IMPORT_C RHufEncodeWriteStream(RWriteStream& aHost,const TUint* aHufBits=Huffman::DefaultBits());
80 IMPORT_C void Open(RWriteStream& aHost,const TUint* aHufBits=Huffman::DefaultBits());
82 THufEncodeFilter iFilter;
85 class RHufEncodeReadStream : public RReadStream
88 RHufEncodeReadStream() {}
89 IMPORT_C RHufEncodeReadStream(RReadStream& aHost,const TUint* aHufBits=Huffman::DefaultBits());
90 IMPORT_C void Open(RReadStream& aHost,const TUint* aHufBits=Huffman::DefaultBits());
92 THufEncodeFilter iFilter;
94 class RHufDecodeWriteStream : public RWriteStream
97 RHufDecodeWriteStream() {}
98 inline RHufDecodeWriteStream(const MExternalizer<TStreamRef>& anExter);
99 IMPORT_C RHufDecodeWriteStream(RWriteStream& aHost,const TUint8* aHufTree=Huffman::DefaultTree());
100 IMPORT_C void Open(RWriteStream& aHost,const TUint8* aHufTree=Huffman::DefaultTree());
102 THufDecodeFilter iFilter;
105 #include "S32HUF.INL"