diff -r 000000000000 -r c3e98f10fcf4 localconnectivityservice/obexserviceman/utils/inc/obexutilsopaquedata.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/localconnectivityservice/obexserviceman/utils/inc/obexutilsopaquedata.h Mon Jan 18 21:03:15 2010 +0200 @@ -0,0 +1,71 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Service controller resouce file's opaque_data parser. +* +*/ + + +#ifndef OBEXUTILSOPAQUEDATA_H +#define OBEXUTILSOPAQUEDATA_H + + +// INCLUDES +#include +#include + +const TUint KObexUtilsMaxOpaqueDataStringLen = 0x100; + +// CLASS DECLARATION + +/** +* Process opaque_data field in service controller ECom plug-in resource file. +* opaque_data field contains 2 types of data: string and number. +*/ +NONSHARABLE_CLASS( CObexUtilsOpaqueData ): public CBase + { +public: + + /** + * constructor. + * @param aDes buffer to hold the opaque_data + */ + IMPORT_C CObexUtilsOpaqueData(const TDesC8& aDes); + + /** + * Get string from current location. Return error code if invalid string format.. + * @param aString buffer to hold the parsed string. + * @return Error code. + */ + IMPORT_C TInt GetString(TBuf8 &aString); + + /** + * Get number from current location. Return error code if invalid string format.. + * @param aNumber the parsed number. + * @return Error code. + */ + IMPORT_C TInt GetNumber(TUint &aNumber); + + /* + * Peek if next entry is string by looking for a '\'. + * @return TRUE: is valid string. + * FALSE: is not string. + */ + IMPORT_C TBool IsString(); + +private: + TLex8 iData;// data buffer. + }; + +#endif