bintools/rcomp/inc/LINKARRA.H
author yiluzhu
Fri, 15 Jan 2010 11:38:40 +0000
branchfix
changeset 110 6d26dad20418
parent 0 044383f39525
permissions -rw-r--r--
Test case for Apply linker options

/*
* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of the License "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description: 
*
*/


#include "ARRAY.H"  
#include "ASTRING.H"

class RCBinaryStream;
class ResourceDataStream;

class LinkItem : public ArrayItem
	{
public:
	LinkItem(ResourceDataStream& aStream,const String& aResourceName,const String& aFileName,int aLineNumber);
	virtual void OverwriteLink(RCBinaryStream& os) const=0;
	virtual ostream& StreamOut(ostream& os)=0;
public:
	String iResourceName;	// Name of resource to which link points.
	unsigned long iStreamPosition;
	String iFileName;
	int iLineNumber;
	};

class LinkArray : public Array
	{
	friend ostream& operator<<(ostream& os,LinkArray& o);
public:
	LinkArray();
	~LinkArray();
	void Add(LinkItem* aNewItem);
	void OverwriteLinks ( RCBinaryStream & os ) const;
private:
	static int iInUse;	// Only one instance of this class may exist at a time.
	};

class WordLink : public LinkItem
	{
public:
	WordLink(ResourceDataStream& aStream,const String& aResourceName,const String& aFileName,int aLineNumber);
	virtual void OverwriteLink(RCBinaryStream& os) const;
	virtual ostream& StreamOut(ostream& os);
	static int NumberOfBytesOccupiesInStream();
	};

class LongLink : public LinkItem
	{
public:
	LongLink(ResourceDataStream& aStream,const String& aResourceName,const String& aFileName,int aLineNumber);
	virtual void OverwriteLink(RCBinaryStream& os) const;
	virtual ostream& StreamOut(ostream& os);
	static int NumberOfBytesOccupiesInStream();
	};

class LinkArrayIterator : public ArrayIterator
	{
public:
	LinkArrayIterator(const LinkArray& aArray);
	LinkItem* operator()();
	};