|
1 /* |
|
2 * Copyright (c) 2002-2007 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 "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: Java Registy API header file |
|
15 * |
|
16 */ |
|
17 |
|
18 TAppVersion::TAppVersion() |
|
19 : iMajor(0), iMinor(0), iBuild(0) |
|
20 { |
|
21 } |
|
22 |
|
23 TAppVersion::TAppVersion(const TAppVersion& aAppVersion) |
|
24 : iMajor(aAppVersion.iMajor), iMinor(aAppVersion.iMinor), iBuild(aAppVersion.iBuild) |
|
25 { |
|
26 } |
|
27 |
|
28 TAppVersion::TAppVersion(TInt aMajor, TInt aMinor, TInt aBuild) |
|
29 : iMajor(aMajor), iMinor(aMinor), iBuild(aBuild) |
|
30 { |
|
31 } |
|
32 |
|
33 TAppVersion& TAppVersion::operator =(const TAppVersion& aAppVersion) |
|
34 { |
|
35 // Assignment operator using the copy constructor |
|
36 return *new(this) TAppVersion(aAppVersion); |
|
37 } |
|
38 |
|
39 TBool TAppVersion::operator ==(const TAppVersion& aAppVersion) const |
|
40 { |
|
41 return ((iMajor == aAppVersion.iMajor) && |
|
42 (iMinor == aAppVersion.iMinor) && |
|
43 (iBuild == aAppVersion.iBuild)); |
|
44 } |
|
45 |
|
46 TBool TAppVersion::operator !=(const TAppVersion& aAppVersion) const |
|
47 { |
|
48 return !(*this == aAppVersion); |
|
49 } |
|
50 |
|
51 TBool TAppVersion::operator <(const TAppVersion& aAppVersion) const |
|
52 { |
|
53 return ((iMajor < aAppVersion.iMajor) || |
|
54 ((iMajor == aAppVersion.iMajor) && (iMinor < aAppVersion.iMinor)) || |
|
55 ((iMajor == aAppVersion.iMajor) && (iMinor == aAppVersion.iMinor) && |
|
56 (iBuild < aAppVersion.iBuild))); |
|
57 } |
|
58 |
|
59 TBool TAppVersion::operator >(const TAppVersion& aAppVersion) const |
|
60 { |
|
61 return (aAppVersion < *this); |
|
62 } |
|
63 |
|
64 TBool TAppVersion::operator <=(const TAppVersion& aAppVersion) const |
|
65 { |
|
66 return !(*this > aAppVersion); |
|
67 } |
|
68 |
|
69 TBool TAppVersion::operator >=(const TAppVersion& aAppVersion) const |
|
70 { |
|
71 return !(*this < aAppVersion); |
|
72 } |