analyzetool/commandlineengine/inc/CATParseBinaryFile.h
branchRCL_3
changeset 59 8ad140f3dd41
parent 49 7fdc9a71d314
equal deleted inserted replaced
49:7fdc9a71d314 59:8ad140f3dd41
     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:  Definitions for class CATParseTrace, CProcessData and
       
    15 *               CSubTestData.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef __CATPARSEBINARYFILE_H__
       
    21 #define __CATPARSEBINARYFILE_H__
       
    22 
       
    23 #include "../inc/ATCommonDefines.h"
       
    24 #include "../inc/CATDataSaver.h"
       
    25 #include "../inc/CATBase.h"
       
    26 #include "../inc/catallocs.h"
       
    27 
       
    28 /**
       
    29 * Parses raw trace data to AnalyzeTool specific data file.
       
    30 */
       
    31 class CATParseBinaryFile : public CATBase
       
    32 {
       
    33 public:
       
    34 	/**
       
    35 	* Constructor
       
    36 	*/
       
    37 	CATParseBinaryFile();
       
    38 
       
    39 	/**
       
    40 	* Main function to start parse.
       
    41 	*
       
    42 	* @param pFileName A trace file name
       
    43 	* @param pOutputFileName Pointer to output file name
       
    44 	*/
       
    45 	bool StartParse( const char* pFileName, const char* pOutputFileName );
       
    46 
       
    47 	/**
       
    48 	* Get data saver
       
    49 	* @return CATDataSaver*
       
    50 	*/
       
    51 	CATDataSaver* GetDataSaver(void);
       
    52 	
       
    53 	/**
       
    54 	* Gets 64bit number from input string
       
    55 	* @param cVal Input data
       
    56 	* @return Acquired number
       
    57 	*/
       
    58 	unsigned __int64 StringToNum64( unsigned char* cVal );
       
    59 
       
    60 	/**
       
    61 	* Gets 32bit number from input string
       
    62 	* @param cVal Input data
       
    63 	* @return Acquired number
       
    64 	*/
       
    65 	unsigned long StringToNum32( unsigned char* cVal );
       
    66 
       
    67 	/**
       
    68 	* Get next string from file
       
    69 	* @param pData Acquired data
       
    70 	* @param pIn Input file stream
       
    71 	* @param pStreamPos Actuall position in file
       
    72 	* @param pStreamEnd End of file
       
    73 	* @return false if no error
       
    74 	*/
       
    75 	bool GetString( unsigned char* pData, ifstream &pIn, size_t &streamPos,  size_t streamEnd );
       
    76 
       
    77 	/**
       
    78 	* Get next 8bit number from file
       
    79 	* @param pData Acquired data
       
    80 	* @param pIn Input file stream
       
    81 	* @param pStreamPos Actuall position in file
       
    82 	* @param pStreamEnd End of file
       
    83 	* @return false if no error
       
    84 	*/
       
    85 	bool GetNum8( unsigned char* pData, ifstream &pIn, size_t &pStreamPos, size_t pStreamEnd );
       
    86 
       
    87 	/**
       
    88 	* Get next 32bit number from file
       
    89 	* @param pData Acquired data
       
    90 	* @param pIn Input file stream
       
    91 	* @param pStreamPos Actuall position in file
       
    92 	* @param pStreamEnd End of file
       
    93 	* @return false if no error
       
    94 	*/
       
    95 	bool GetNum32( unsigned char* pData, ifstream &pIn, size_t &pStreamPos, size_t pStreamEnd );
       
    96 
       
    97 	/**
       
    98 	* Get next 64bit number from file
       
    99 	* @param pData Acquired data
       
   100 	* @param pIn Input file stream
       
   101 	* @param pStreamPos Actuall position in file
       
   102 	* @param pStreamEnd End of file
       
   103 	* @return false if no error
       
   104 	*/
       
   105 	bool GetNum64( unsigned char* pData, ifstream &pIn, size_t &pStreamPos, size_t pStreamEnd );
       
   106 
       
   107 #ifndef MODULE_TEST
       
   108 private:
       
   109 #endif
       
   110 	CATDataSaver m_DataSaver; /** Data saver */
       
   111 };
       
   112 
       
   113 #endif