crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/ROFS/Structures/TRofsHeader.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.IO;
       
    21 using SymbianStructuresLib.Version;
       
    22 
       
    23 namespace SymbianImageLib.ROFS.Structures
       
    24 {
       
    25     internal class TRofsHeader
       
    26     {
       
    27         #region Constructors
       
    28         #endregion
       
    29 
       
    30         #region API
       
    31         public void Read( BinaryReader aReader )
       
    32         {
       
    33             iIdentifier = SymbianUtils.Strings.StringParsingUtils.BytesToString( aReader.ReadBytes( 4 ) );
       
    34             iHeaderSize = aReader.ReadByte();
       
    35             iReserved = aReader.ReadByte();
       
    36             iRofsFormatVersion = aReader.ReadUInt16();
       
    37             iDirTreeOffset = aReader.ReadUInt32();
       
    38             iDirTreeSize = aReader.ReadUInt32();
       
    39             iDirFileEntriesOffset = aReader.ReadUInt32();
       
    40             iDirFileEntriesSize = aReader.ReadUInt32();
       
    41             iTime = aReader.ReadInt64();
       
    42             iImageVersion.Read( aReader );
       
    43             iImageSize = aReader.ReadUInt32();
       
    44             iCheckSum = aReader.ReadUInt32();
       
    45             iMaxImageSize = aReader.ReadUInt32();
       
    46         }
       
    47         #endregion
       
    48 
       
    49         #region Properties
       
    50         public string Identifier
       
    51         {
       
    52             get { return iIdentifier; }
       
    53         }
       
    54 
       
    55         public uint Size
       
    56         {
       
    57             get
       
    58             {
       
    59                 return iHeaderSize;
       
    60             }
       
    61         }
       
    62 
       
    63         public uint RofsFormatVersion
       
    64         {
       
    65             get { return iRofsFormatVersion; }
       
    66         }
       
    67 
       
    68         public uint DirTreeOffset
       
    69         {
       
    70             get { return iDirTreeOffset; }
       
    71         }
       
    72 
       
    73         public uint DirTreeSize
       
    74         {
       
    75             get { return iDirTreeSize; }
       
    76         }
       
    77 
       
    78         public uint DirFileEntriesOffset
       
    79         {
       
    80             get { return iDirFileEntriesOffset; }
       
    81         }
       
    82 
       
    83         public uint DirFileEntriesSize
       
    84         {
       
    85             get { return iDirFileEntriesSize; }
       
    86         }
       
    87 
       
    88         public uint CheckSum
       
    89         {
       
    90             get { return iCheckSum; }
       
    91         }
       
    92         #endregion
       
    93 
       
    94         #region Data members
       
    95         private string iIdentifier = string.Empty;
       
    96         private byte iHeaderSize;
       
    97         private byte iReserved;
       
    98         private ushort iRofsFormatVersion;
       
    99         private uint iDirTreeOffset;	// offset to start of directory structure
       
   100         private uint iDirTreeSize;		// size in bytes of directory
       
   101         private uint iDirFileEntriesOffset;	// offset to start of file entries
       
   102         private uint iDirFileEntriesSize;	// size in bytes of file entry block
       
   103         private long iTime;
       
   104         private TVersion iImageVersion = new TVersion();		// licensee image version
       
   105         private uint iImageSize;
       
   106         private uint iCheckSum;
       
   107         private uint iMaxImageSize;
       
   108         #endregion
       
   109     }
       
   110 }