sl@0: // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // ULogger sl@0: // sl@0: // sl@0: sl@0: /** sl@0: @file sl@0: @internalTechnology sl@0: @prototype sl@0: */ sl@0: sl@0: #ifndef INPUTDATA_H_ sl@0: #define INPUTDATA_H_ sl@0: sl@0: #ifdef __SYMBIAN32__ sl@0: #include sl@0: #include sl@0: #else sl@0: #include sl@0: #include sl@0: #endif sl@0: sl@0: sl@0: //define ControlData type sl@0: typedef char ControlData; sl@0: sl@0: //const values sl@0: const char DATA_SEPARATOR = ' '; //space sl@0: const char CD_CR = 0x0D; //end os line in MacOS style sl@0: const char CD_LF = 0x0A; //end of line in Unix/Linux style sl@0: const int SIZE_OF_EOL = 2; sl@0: const char CD_EOL[SIZE_OF_EOL] = {CD_CR,CD_LF}; //end of line in Windows OS style sl@0: sl@0: sl@0: sl@0: /**This class should be used to create, update and parse Control Data packages. sl@0: Write type functions create new control data chunk and update existing one, whereas sl@0: read type functions can parse and return certain data from existing control data packages. sl@0: */ sl@0: class CInputData sl@0: { sl@0: public: sl@0: IMPORT_C CInputData(unsigned int aMinPackageSize=2); sl@0: IMPORT_C virtual ~CInputData(); sl@0: sl@0: //read type functions sl@0: IMPORT_C unsigned long GetSize(const ControlData *aDataPtr); sl@0: IMPORT_C unsigned long GetChunksCount(const ControlData *aDataPtr); sl@0: IMPORT_C const void* GetChunk(const ControlData* aDataPtr, unsigned long aChunkNumber, unsigned long &aChunkSize); sl@0: sl@0: //write type functions sl@0: IMPORT_C ControlData* CreatePackage(void* aCommand, signed long aCommandSize); sl@0: IMPORT_C unsigned long AppendNewData(ControlData *&aDataPtr, const void* aAddData, unsigned long aAddDataSize); sl@0: sl@0: private: sl@0: unsigned int iMinPackageSize; sl@0: unsigned long FindAvailablePlace(const ControlData *aDataPtr); sl@0: unsigned long CalcNumberOfPaddingChars(const ControlData *aDataPtr); sl@0: sl@0: }; sl@0: sl@0: #endif /*CONTROLDATAMANAGER_H_*/