1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/persistentdata/traceservices/tracefw/ulogger/src/pluginframework/inputdata.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,74 @@
1.4 +// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// ULogger
1.18 +//
1.19 +//
1.20 +
1.21 +/**
1.22 + @file
1.23 + @internalTechnology
1.24 + @prototype
1.25 +*/
1.26 +
1.27 +#ifndef INPUTDATA_H_
1.28 +#define INPUTDATA_H_
1.29 +
1.30 +#ifdef __SYMBIAN32__
1.31 +#include <e32base.h>
1.32 +#include <e32cmn.h>
1.33 +#else
1.34 +#include <iostream.h>
1.35 +#include <memory.h>
1.36 +#endif
1.37 +
1.38 +
1.39 +//define ControlData type
1.40 +typedef char ControlData;
1.41 +
1.42 +//const values
1.43 +const char DATA_SEPARATOR = ' '; //space
1.44 +const char CD_CR = 0x0D; //end os line in MacOS style
1.45 +const char CD_LF = 0x0A; //end of line in Unix/Linux style
1.46 +const int SIZE_OF_EOL = 2;
1.47 +const char CD_EOL[SIZE_OF_EOL] = {CD_CR,CD_LF}; //end of line in Windows OS style
1.48 +
1.49 +
1.50 +
1.51 +/**This class should be used to create, update and parse Control Data packages.
1.52 +Write type functions create new control data chunk and update existing one, whereas
1.53 +read type functions can parse and return certain data from existing control data packages.
1.54 +*/
1.55 +class CInputData
1.56 +{
1.57 +public:
1.58 + IMPORT_C CInputData(unsigned int aMinPackageSize=2);
1.59 + IMPORT_C virtual ~CInputData();
1.60 +
1.61 + //read type functions
1.62 + IMPORT_C unsigned long GetSize(const ControlData *aDataPtr);
1.63 + IMPORT_C unsigned long GetChunksCount(const ControlData *aDataPtr);
1.64 + IMPORT_C const void* GetChunk(const ControlData* aDataPtr, unsigned long aChunkNumber, unsigned long &aChunkSize);
1.65 +
1.66 + //write type functions
1.67 + IMPORT_C ControlData* CreatePackage(void* aCommand, signed long aCommandSize);
1.68 + IMPORT_C unsigned long AppendNewData(ControlData *&aDataPtr, const void* aAddData, unsigned long aAddDataSize);
1.69 +
1.70 +private:
1.71 + unsigned int iMinPackageSize;
1.72 + unsigned long FindAvailablePlace(const ControlData *aDataPtr);
1.73 + unsigned long CalcNumberOfPaddingChars(const ControlData *aDataPtr);
1.74 +
1.75 +};
1.76 +
1.77 +#endif /*CONTROLDATAMANAGER_H_*/