secureswitools/swisistools/source/sisxlibrary/version.h
changeset 0 ba25891c3a9e
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     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 * Note: This file may contain code to generate corrupt files for test purposes.
       
    16 * Such code is excluded from production builds by use of compiler defines;
       
    17 * it is recommended that such code should be removed if this code is ever published publicly.
       
    18 *
       
    19 */
       
    20 
       
    21 
       
    22 /**
       
    23  @file
       
    24  @internalComponent
       
    25  @released
       
    26 */
       
    27 
       
    28 #ifndef __VERSION_H__
       
    29 #define __VERSION_H__
       
    30 
       
    31 // tranport for version values
       
    32 
       
    33 namespace SWIVersion
       
    34 {
       
    35 
       
    36 const int KIrrelevant = -1;
       
    37 
       
    38 class TVersion
       
    39 	{
       
    40 public:
       
    41 	TVersion ();
       
    42 	TVersion (const TVersion& aVersion);
       
    43 	TVersion (const TInt32 aMajor, const TInt32 aMinor, const TInt32 aBuild);
       
    44 
       
    45 	TInt32 Major () const;
       
    46 	TInt32 Minor () const;
       
    47 	TInt32 Build () const;
       
    48 
       
    49 private:
       
    50 	TInt32	iMajor;
       
    51 	TInt32	iMinor;
       
    52 	TInt32	iBuild;
       
    53 	};
       
    54 };
       
    55 
       
    56 
       
    57 /*
       
    58  * seclib already has TVersion defined. This causes multiply defined error. 
       
    59  * Hence, the namespace.
       
    60  *
       
    61  * The namespace has been opened so that it does not affect the exisiting implementations.
       
    62  */
       
    63 
       
    64 using namespace SWIVersion;
       
    65 
       
    66 inline TVersion::TVersion () :
       
    67 		iMajor (KIrrelevant),
       
    68 		iMinor (KIrrelevant),
       
    69 		iBuild (KIrrelevant)
       
    70 	{
       
    71 	}
       
    72 
       
    73 inline TVersion::TVersion (const TVersion& aVersion) :
       
    74 		iMajor (aVersion.iMajor),
       
    75 		iMinor (aVersion.iMinor),
       
    76 		iBuild (aVersion.iBuild)
       
    77 	{
       
    78 	}
       
    79 
       
    80 inline TVersion::TVersion (const TInt32 aMajor, const TInt32 aMinor, const TInt32 aBuild) :
       
    81 		iMajor (aMajor),
       
    82 		iMinor (aMinor),
       
    83 		iBuild (aBuild)
       
    84 	{
       
    85 	}
       
    86 
       
    87 
       
    88 inline TInt32 TVersion::Major () const
       
    89 	{
       
    90 	return iMajor;
       
    91 	}
       
    92 
       
    93 inline TInt32 TVersion::Minor () const
       
    94 	{
       
    95 	return iMinor;
       
    96 	}
       
    97 
       
    98 inline TInt32 TVersion::Build () const
       
    99 	{
       
   100 	return iBuild;
       
   101 	}
       
   102 
       
   103 
       
   104 #endif // __VERSION_H__
       
   105