Update contrib.
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
36 //define ControlData type
37 typedef char ControlData;
40 const char DATA_SEPARATOR = ' '; //space
41 const char CD_CR = 0x0D; //end os line in MacOS style
42 const char CD_LF = 0x0A; //end of line in Unix/Linux style
43 const int SIZE_OF_EOL = 2;
44 const char CD_EOL[SIZE_OF_EOL] = {CD_CR,CD_LF}; //end of line in Windows OS style
48 /**This class should be used to create, update and parse Control Data packages.
49 Write type functions create new control data chunk and update existing one, whereas
50 read type functions can parse and return certain data from existing control data packages.
55 IMPORT_C CInputData(unsigned int aMinPackageSize=2);
56 IMPORT_C virtual ~CInputData();
59 IMPORT_C unsigned long GetSize(const ControlData *aDataPtr);
60 IMPORT_C unsigned long GetChunksCount(const ControlData *aDataPtr);
61 IMPORT_C const void* GetChunk(const ControlData* aDataPtr, unsigned long aChunkNumber, unsigned long &aChunkSize);
63 //write type functions
64 IMPORT_C ControlData* CreatePackage(void* aCommand, signed long aCommandSize);
65 IMPORT_C unsigned long AppendNewData(ControlData *&aDataPtr, const void* aAddData, unsigned long aAddDataSize);
68 unsigned int iMinPackageSize;
69 unsigned long FindAvailablePlace(const ControlData *aDataPtr);
70 unsigned long CalcNumberOfPaddingChars(const ControlData *aDataPtr);
74 #endif /*CONTROLDATAMANAGER_H_*/