crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Version/TVersion.cs
changeset 0 818e61de6cd1
equal deleted inserted replaced
-1:000000000000 0:818e61de6cd1
       
     1 /*
       
     2 * Copyright (c) 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 "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 using System;
       
    18 using System.Collections.Generic;
       
    19 using System.Text;
       
    20 using System.Text.RegularExpressions;
       
    21 using System.IO;
       
    22 using System.Runtime.InteropServices;
       
    23 using SymbianUtils.Streams;
       
    24 
       
    25 namespace SymbianStructuresLib.Version
       
    26 {
       
    27     public class TVersion
       
    28     {
       
    29         #region Constructors
       
    30         public TVersion()
       
    31         {
       
    32             iMajor = 0;
       
    33             iMinor = 0;
       
    34             iBuild = 0;
       
    35         }
       
    36 
       
    37         public TVersion( SymbianStreamReaderLE aReader )
       
    38         {
       
    39             iMajor = aReader.ReadInt8();
       
    40             iMinor = aReader.ReadInt8();
       
    41             iBuild = aReader.ReadInt16();
       
    42         }
       
    43         #endregion
       
    44 
       
    45         #region API
       
    46         public void Read( BinaryReader aReader )
       
    47         {
       
    48             Major = aReader.ReadSByte();
       
    49             Minor = aReader.ReadSByte();
       
    50             Build = aReader.ReadInt16();
       
    51         }
       
    52         #endregion
       
    53 
       
    54         #region Properties
       
    55         public uint Size
       
    56         {
       
    57             get { return 4; }
       
    58         }
       
    59 
       
    60         public sbyte Major
       
    61         {
       
    62             get { return iMajor; }
       
    63             set { iMajor = value; }
       
    64         }
       
    65 
       
    66         public sbyte Minor
       
    67         {
       
    68             get { return iMinor; }
       
    69             set { iMinor = value; }
       
    70         }
       
    71 
       
    72         public Int16 Build
       
    73         {
       
    74             get { return iBuild; }
       
    75             set { iBuild = value; }
       
    76         }
       
    77         #endregion
       
    78         
       
    79         #region From System.Object
       
    80         public override string ToString()
       
    81         {
       
    82             StringBuilder ret = new StringBuilder();
       
    83             ret.AppendFormat( "{0}.{1}.{2:d4}", iMajor, iMinor, iBuild );
       
    84             return ret.ToString();
       
    85         }
       
    86         #endregion
       
    87 
       
    88         #region Internal methods
       
    89         #endregion
       
    90 
       
    91         #region Data members
       
    92         private sbyte iMajor;
       
    93         private sbyte iMinor;
       
    94         private Int16 iBuild;
       
    95         #endregion
       
    96     }
       
    97 }