|
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 * As specified in SGL.GT0188.251 |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 /** |
|
21 @file |
|
22 @publishedPartner |
|
23 @released |
|
24 */ |
|
25 |
|
26 #ifndef __SISVERSIONRANGE_H__ |
|
27 #define __SISVERSIONRANGE_H__ |
|
28 |
|
29 #include "sisversion.h" |
|
30 #include "version.h" |
|
31 |
|
32 class CSISVersionRange : public CStructure <CSISFieldRoot::ESISVersionRange> |
|
33 |
|
34 { |
|
35 private: |
|
36 void InsertMembers (); |
|
37 |
|
38 public: |
|
39 /** |
|
40 * Default constructor |
|
41 */ |
|
42 explicit CSISVersionRange (const bool aRequired = true); |
|
43 /** |
|
44 * Copy constructor |
|
45 */ |
|
46 CSISVersionRange (const CSISVersionRange& aInitialiser); |
|
47 /** |
|
48 * Verifies the object state. In case of any inconsistency the |
|
49 * function will throw an exception. |
|
50 * @param aLanguages Language count. |
|
51 */ |
|
52 virtual void Verify (const TUint32 aLanguages) const; |
|
53 /** |
|
54 * Class name |
|
55 */ |
|
56 virtual std::string Name () const; |
|
57 /** |
|
58 * Check if the object is required or not. The function will |
|
59 * return false if either the object is mandatory(Required() |
|
60 * returns true) or any of the version (To or From) is specified. |
|
61 */ |
|
62 virtual bool WasteOfSpace () const; |
|
63 /** |
|
64 * Set a new value for version range. |
|
65 * @param aFrom New from version |
|
66 * @param aTo New to version. |
|
67 */ |
|
68 void SetVersionRange (const TVersion& aFrom, const TVersion& aTo); |
|
69 /** |
|
70 * Adds the write the package details into the stream. |
|
71 * @param aStream - Stream in which the package entries need to be written. |
|
72 * @param aVerbose - If this option is set then detail description of pkg |
|
73 * will be written into the stream. |
|
74 */ |
|
75 void AddPackageEntry(std::wostream& aStream, bool aVerbose) const; |
|
76 /** |
|
77 * Get the value of from version. |
|
78 */ |
|
79 inline const CSISVersion& FromVersion() const; |
|
80 /** |
|
81 * Get the value of to version. |
|
82 */ |
|
83 inline const CSISVersion& ToVersion() const; |
|
84 |
|
85 private: |
|
86 CSISVersion iFromVersion; |
|
87 CSISVersion iToVersion; |
|
88 }; |
|
89 |
|
90 |
|
91 |
|
92 |
|
93 inline void CSISVersionRange::InsertMembers () |
|
94 { |
|
95 InsertMember (iFromVersion); |
|
96 InsertMember (iToVersion); |
|
97 } |
|
98 |
|
99 inline CSISVersionRange::CSISVersionRange (const bool aRequired) : |
|
100 CStructure <CSISFieldRoot::ESISVersionRange> (aRequired), |
|
101 iFromVersion (true, true), |
|
102 iToVersion (false, true) |
|
103 { |
|
104 InsertMembers (); |
|
105 } |
|
106 |
|
107 inline CSISVersionRange::CSISVersionRange (const CSISVersionRange& aInitialiser) : |
|
108 CStructure <CSISFieldRoot::ESISVersionRange> (aInitialiser), |
|
109 iFromVersion (aInitialiser.iFromVersion), |
|
110 iToVersion (aInitialiser.iToVersion) |
|
111 { |
|
112 InsertMembers (); |
|
113 } |
|
114 |
|
115 inline void CSISVersionRange::SetVersionRange (const TVersion& aFrom, const TVersion& aTo) |
|
116 { |
|
117 iFromVersion.SetVersion (aFrom); |
|
118 iToVersion.SetVersion (aTo); |
|
119 } |
|
120 |
|
121 inline const CSISVersion& CSISVersionRange::FromVersion() const |
|
122 { |
|
123 return iFromVersion; |
|
124 } |
|
125 |
|
126 inline const CSISVersion& CSISVersionRange::ToVersion() const |
|
127 { |
|
128 return iToVersion; |
|
129 } |
|
130 |
|
131 |
|
132 #endif // __SISVERSIONRANGE_H__ |
|
133 |