epoc32/include/swi/AppVersion.inl
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
permissions -rw-r--r--
Final list of Symbian^2 public API header files
     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 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: Java Registy API header file
    15 *
    16 */
    17 
    18 #ifndef TAPPVERSIONINL_H
    19 #define TAPPVERSIONINL_H
    20 
    21 TAppVersion::TAppVersion()
    22     : iMajor(0), iMinor(0), iBuild(0)
    23     {
    24     }
    25 
    26 TAppVersion::TAppVersion(const TAppVersion& aAppVersion)
    27     : iMajor(aAppVersion.iMajor), iMinor(aAppVersion.iMinor), iBuild(aAppVersion.iBuild)
    28     {
    29     }
    30 
    31 TAppVersion::TAppVersion(TInt aMajor, TInt aMinor, TInt aBuild)
    32     : iMajor(aMajor), iMinor(aMinor), iBuild(aBuild)
    33     {
    34     }
    35 
    36 TAppVersion& TAppVersion::operator =(const TAppVersion& aAppVersion)
    37     {
    38     // Assignment operator using the copy constructor
    39     return *new (this) TAppVersion(aAppVersion);
    40     }
    41 
    42 TBool TAppVersion::operator ==(const TAppVersion& aAppVersion) const
    43     {
    44     return ((iMajor == aAppVersion.iMajor) && 
    45             (iMinor == aAppVersion.iMinor) &&
    46             (iBuild == aAppVersion.iBuild));
    47     }
    48 
    49 TBool TAppVersion::operator !=(const TAppVersion& aAppVersion) const
    50     {
    51     return !(*this == aAppVersion);
    52     }
    53 
    54 TBool TAppVersion::operator <(const TAppVersion& aAppVersion) const
    55     {
    56     return ((iMajor < aAppVersion.iMajor) ||
    57         ((iMajor == aAppVersion.iMajor) && (iMinor < aAppVersion.iMinor)) ||
    58         ((iMajor == aAppVersion.iMajor) && (iMinor == aAppVersion.iMinor) && 
    59          (iBuild < aAppVersion.iBuild)));
    60     }
    61 
    62 TBool TAppVersion::operator >(const TAppVersion& aAppVersion) const
    63     {
    64     return (aAppVersion < *this);
    65     }
    66 
    67 TBool TAppVersion::operator <=(const TAppVersion& aAppVersion) const
    68     {
    69     return !(*this > aAppVersion);
    70     }
    71 
    72 TBool TAppVersion::operator >=(const TAppVersion& aAppVersion) const
    73     {
    74     return !(*this < aAppVersion);
    75     }
    76 
    77 #endif // TAPPVERSIONINL_H
    78 
    79 //End of File