|
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 #include "ARRAY.H" |
|
20 #include "ASTRING.H" |
|
21 |
|
22 class RCBinaryStream; |
|
23 class ResourceDataStream; |
|
24 |
|
25 class LinkItem : public ArrayItem |
|
26 { |
|
27 public: |
|
28 LinkItem(ResourceDataStream& aStream,const String& aResourceName,const String& aFileName,int aLineNumber); |
|
29 virtual void OverwriteLink(RCBinaryStream& os) const=0; |
|
30 virtual ostream& StreamOut(ostream& os)=0; |
|
31 public: |
|
32 String iResourceName; // Name of resource to which link points. |
|
33 unsigned long iStreamPosition; |
|
34 String iFileName; |
|
35 int iLineNumber; |
|
36 }; |
|
37 |
|
38 class LinkArray : public Array |
|
39 { |
|
40 friend ostream& operator<<(ostream& os,LinkArray& o); |
|
41 public: |
|
42 LinkArray(); |
|
43 ~LinkArray(); |
|
44 void Add(LinkItem* aNewItem); |
|
45 void OverwriteLinks ( RCBinaryStream & os ) const; |
|
46 private: |
|
47 static int iInUse; // Only one instance of this class may exist at a time. |
|
48 }; |
|
49 |
|
50 class WordLink : public LinkItem |
|
51 { |
|
52 public: |
|
53 WordLink(ResourceDataStream& aStream,const String& aResourceName,const String& aFileName,int aLineNumber); |
|
54 virtual void OverwriteLink(RCBinaryStream& os) const; |
|
55 virtual ostream& StreamOut(ostream& os); |
|
56 static int NumberOfBytesOccupiesInStream(); |
|
57 }; |
|
58 |
|
59 class LongLink : public LinkItem |
|
60 { |
|
61 public: |
|
62 LongLink(ResourceDataStream& aStream,const String& aResourceName,const String& aFileName,int aLineNumber); |
|
63 virtual void OverwriteLink(RCBinaryStream& os) const; |
|
64 virtual ostream& StreamOut(ostream& os); |
|
65 static int NumberOfBytesOccupiesInStream(); |
|
66 }; |
|
67 |
|
68 class LinkArrayIterator : public ArrayIterator |
|
69 { |
|
70 public: |
|
71 LinkArrayIterator(const LinkArray& aArray); |
|
72 LinkItem* operator()(); |
|
73 }; |