localconnectivityservice/obexserviceman/utils/inc/obexutilsopaquedata.h
branchRCL_3
changeset 39 4096754ee773
parent 38 3dcb815346df
child 40 52a167391590
equal deleted inserted replaced
38:3dcb815346df 39:4096754ee773
     1 /*
       
     2 * Copyright (c) 2002 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: 
       
    15 *     Service controller resouce file's opaque_data parser.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef OBEXUTILSOPAQUEDATA_H
       
    21 #define OBEXUTILSOPAQUEDATA_H
       
    22 
       
    23 
       
    24 //  INCLUDES
       
    25 #include <e32std.h>
       
    26 #include <e32cons.h>
       
    27 
       
    28 const TUint KObexUtilsMaxOpaqueDataStringLen = 0x100;
       
    29 
       
    30 // CLASS DECLARATION
       
    31 
       
    32 /**
       
    33 * Process opaque_data field in service controller ECom plug-in resource file.
       
    34 * opaque_data field contains 2 types of data: string and number.
       
    35 */
       
    36 NONSHARABLE_CLASS( CObexUtilsOpaqueData ): public CBase
       
    37     {
       
    38 public:
       
    39 
       
    40 	/**
       
    41     * constructor.
       
    42 	* @param	aDes buffer to hold the opaque_data
       
    43     */
       
    44     IMPORT_C CObexUtilsOpaqueData(const TDesC8& aDes);
       
    45 
       
    46 	/**
       
    47     * Get string from current location. Return error code if invalid string format..
       
    48 	* @param	aString buffer to hold the parsed string.
       
    49 	* @return	Error code.
       
    50     */
       
    51     IMPORT_C TInt GetString(TBuf8<KObexUtilsMaxOpaqueDataStringLen> &aString);
       
    52 
       
    53 	/**
       
    54     * Get number from current location. Return error code if invalid string format..
       
    55 	* @param	aNumber the parsed number.
       
    56 	* @return	Error code.
       
    57     */
       
    58     IMPORT_C TInt GetNumber(TUint &aNumber);
       
    59 
       
    60     /*
       
    61 	* Peek if next entry is string by looking for a '\'.
       
    62 	* @return	TRUE:   is valid string.
       
    63 	*			FALSE:	is not string.
       
    64 	*/
       
    65     IMPORT_C TBool IsString();
       
    66 
       
    67 private:
       
    68     TLex8 iData;// data buffer.
       
    69     };
       
    70 
       
    71 #endif