|
1 /* |
|
2 * Copyright (c) 2004-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 /** |
|
20 @file |
|
21 @internalComponent |
|
22 @released |
|
23 */ |
|
24 |
|
25 #include "sisdependency.h" |
|
26 #include "exception.h" |
|
27 |
|
28 |
|
29 void CSISDependency::InsertMembers () |
|
30 { |
|
31 InsertMember (iUid); |
|
32 InsertMember (iVersionRange); |
|
33 InsertMember (iDependencyNames); |
|
34 } |
|
35 |
|
36 |
|
37 CSISDependency::CSISDependency (const CSISDependency& aInitialiser) : |
|
38 CStructure <CSISFieldRoot::ESISDependency> (aInitialiser), |
|
39 iDependencyNames (aInitialiser.iDependencyNames), |
|
40 iVersionRange (aInitialiser.iVersionRange), |
|
41 iUid (aInitialiser.iUid) |
|
42 { |
|
43 InsertMembers (); |
|
44 } |
|
45 |
|
46 |
|
47 CSISDependency::CSISDependency (const CSISUid::TUid aUID, const TVersion& aFrom, const TVersion& aTo) |
|
48 { |
|
49 InsertMembers (); |
|
50 iUid.SetUID (aUID); |
|
51 iVersionRange.SetVersionRange (aFrom, aTo); |
|
52 } |
|
53 |
|
54 |
|
55 |
|
56 void CSISDependency::Verify (const TUint32 aLanguages) const |
|
57 { |
|
58 CStructure <CSISFieldRoot::ESISDependency>::Verify (aLanguages); |
|
59 CSISException::ThrowIf ( iDependencyNames.size () != aLanguages, |
|
60 CSISException::ELanguage, |
|
61 "total of names of dependency or target devices differs from language count"); |
|
62 } |
|
63 |
|
64 |
|
65 |
|
66 std::string CSISDependency::Name () const |
|
67 { |
|
68 return "Dependency"; |
|
69 } |
|
70 |
|
71 void CSISDependency::AddPackageEntry(std::wostream& aStream, bool aVerbose) const |
|
72 { |
|
73 aStream << ((iDependencyType == ETargetDependency)?L"[" : L"("); |
|
74 iUid.AddPackageEntry(aStream, aVerbose); |
|
75 aStream << ((iDependencyType == ETargetDependency)?L"]," : L"),"); |
|
76 iVersionRange.AddPackageEntry(aStream, aVerbose); |
|
77 aStream << L" ,{"; |
|
78 for (int i = 0; i < iDependencyNames.size(); ++i) |
|
79 { |
|
80 aStream << L"\""; |
|
81 iDependencyNames[i].AddPackageEntry(aStream, aVerbose); |
|
82 aStream << L"\""; |
|
83 if ((i+1) < iDependencyNames.size()) |
|
84 { |
|
85 aStream << L","; |
|
86 } |
|
87 } |
|
88 aStream << L"}" << std::endl << std::endl; |
|
89 } |
|
90 |