1 /* |
|
2 * Copyright (c) 2008-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 * This file defines a class responsible for extracting files from a compound package. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 /** |
|
21 @file |
|
22 @internalComponent |
|
23 exampleCode |
|
24 */ |
|
25 |
|
26 #ifndef SIFREFBINPKGEXTRACTOR_H |
|
27 #define SIFREFBINPKGEXTRACTOR_H |
|
28 |
|
29 #include <e32base.h> |
|
30 #include <f32file.h> |
|
31 #include <bacline.h> |
|
32 #include <usif/sts/sts.h> |
|
33 #include <usif/sts/sts.h> |
|
34 #include <usif/sif/sifcommon.h> |
|
35 |
|
36 namespace Usif |
|
37 { |
|
38 namespace SifRefBinPkgExtractor |
|
39 { |
|
40 |
|
41 /** |
|
42 CAuxNode is an auxiliary node class used for the processing of reference embedded packages |
|
43 without implementing a walk-tree algorithm. The BuildPkgTreeL() function takes a list of CAuxNode |
|
44 objects as an argument and fills it with extracted packages. |
|
45 */ |
|
46 class CAuxNode : public CBase |
|
47 { |
|
48 public: |
|
49 /** |
|
50 Creates an instance of the CAuxNode object. |
|
51 */ |
|
52 static CAuxNode* NewLC(const TDesC& aFileName, TBool aForeign, CAuxNode& aParent); |
|
53 static CAuxNode* NewLC(const RFile& aFile, TBool aForeign, CAuxNode& aParent); |
|
54 /** |
|
55 Destructor. |
|
56 */ |
|
57 virtual ~CAuxNode(); |
|
58 |
|
59 /** |
|
60 Returns the name of the extracted package associated with this auxiliary node. |
|
61 */ |
|
62 const TDesC& FileNameL() const { return *iFileName; } |
|
63 |
|
64 /** |
|
65 Checks if the extracted package associated with this node it a root component. |
|
66 */ |
|
67 TBool Root() const { return iParent == NULL; } |
|
68 |
|
69 /** |
|
70 Checks if the extracted package associated with this node is of the reference type. |
|
71 */ |
|
72 TBool Foreign() const { return iForeign; } |
|
73 |
|
74 /** |
|
75 Associates aCompInfo with this auxiliary node. |
|
76 */ |
|
77 void SetCompInfoL(CComponentInfo* aCompInfo); |
|
78 |
|
79 /** |
|
80 Associates aNode with this auxiliary node. |
|
81 */ |
|
82 void SetNodeL(CComponentInfo::CNode* aNode); |
|
83 |
|
84 /** |
|
85 Sets the CNode object associated with this auxiliary node as a root node of aCompInfo. |
|
86 */ |
|
87 void SetAsRootNodeL(CComponentInfo& aCompInfo); |
|
88 |
|
89 /** |
|
90 Registers a child CNode object associated with this auxiliary node to its parrent. |
|
91 This method is provided for build a tree of CComponentInfo nodes from a flat tree |
|
92 of auxiliary nodes. After this call the auxiliary node is no longer associated with its |
|
93 CNode object. |
|
94 */ |
|
95 void RegisterChildToParentL(); |
|
96 |
|
97 private: |
|
98 CAuxNode(); |
|
99 CAuxNode& operator=(const CAuxNode& other); |
|
100 CAuxNode(const CAuxNode& other); |
|
101 |
|
102 TBool iForeign; |
|
103 HBufC* iFileName; |
|
104 CAuxNode* iParent; |
|
105 CComponentInfo::CNode* iNode; |
|
106 CComponentInfo* iCompInfo; |
|
107 }; |
|
108 |
|
109 /** |
|
110 Builds a tree of the files embedded in the reference binary package specified by aInFileName. |
|
111 The paths to the extracted embedded packages are returned in aFlatTree. This flat list can be |
|
112 simply processed asynchronously without implementing a walk-tree algorithm in the Active Object |
|
113 context. However, it contains the information needed to build a real tree of the |
|
114 CComponentInfo::CNode objects. |
|
115 */ |
|
116 void BuildPkgTreeL(RStsSession& aSts, const TDesC& aInFileName, const TDesC& aTempDir, RPointerArray<CAuxNode>& aFlatTree, CAuxNode* aParent = NULL); |
|
117 |
|
118 /** |
|
119 Builds a tree of the files embedded in the reference binary package specified by aInFile. |
|
120 The paths to the extracted embedded packages are returned in aFlatTree. This flat list can be |
|
121 simply processed asynchronously without implementing a walk-tree algorithm in the Active Object |
|
122 context. However, it contains the information needed to build a real tree of the |
|
123 CComponentInfo::CNode objects. |
|
124 */ |
|
125 void BuildPkgTreeL(RStsSession& aSts, RFile& aInFile, const TDesC& aTempDir, RPointerArray<CAuxNode>& aFlatTree, CAuxNode* aParent = NULL); |
|
126 } |
|
127 } |
|
128 |
|
129 #endif // SIFREFBINPKGEXTRACTOR_H |
|