bintools/rcomp/inc/INDEXTAB.H
changeset 0 044383f39525
equal deleted inserted replaced
-1:000000000000 0:044383f39525
       
     1 /*
       
     2 * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #if defined(__MSVCDOTNET__) || defined(__TOOLS2__)
       
    20 #include <iostream>
       
    21 using std::ostream;
       
    22 #else //!__MSVCDOTNET__
       
    23 #include <iostream.h>
       
    24 #endif //__MSVCDOTNET__
       
    25 
       
    26 #include "RCBINSTR.H"
       
    27 #include "ARRAY.H"
       
    28 #include "RESOURCE.H"
       
    29 
       
    30 
       
    31 class IndexTableItem : public ArrayItem
       
    32 	{
       
    33 	friend ostream& operator<<(ostream & os,const IndexTableItem& o);
       
    34 	friend RCBinaryStream& operator<<(RCBinaryStream & os,const IndexTableItem& o);
       
    35 public:
       
    36 	IndexTableItem(ResourceHeader* aResource);
       
    37 	~IndexTableItem();
       
    38 	void SetOffset(unsigned long aOffsetToSet);
       
    39 	ResourceHeader& Resource() {return *iResource;}
       
    40 public:
       
    41 	ResourceHeader* iResource;
       
    42 	unsigned char iOffset[2];
       
    43 	};
       
    44 
       
    45 class IndexTable : public Array
       
    46 	{
       
    47 	friend ostream& operator<<(ostream& os,const IndexTable& o);
       
    48 	friend RCBinaryStream& operator<<(RCBinaryStream& os,const IndexTable& o);
       
    49 public:
       
    50 	IndexTable();
       
    51 	~IndexTable();
       
    52 	void Add(ResourceHeader* aResource);
       
    53 	void SetIndexOffset(unsigned long aOffset);
       
    54 private:
       
    55 	static int iInUse;
       
    56 	unsigned char iOffset[2];
       
    57 	};
       
    58 
       
    59 class IndexTableIterator : public ArrayIterator
       
    60 	{
       
    61 public:
       
    62 	IndexTableIterator(const IndexTable & aTable);
       
    63 	IndexTableItem* operator()();
       
    64 	};