natfw/natfwsettings/inc/tnatfwsettingsparser.h
changeset 0 1bce908db942
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     1 /*
       
     2 * Copyright (c) 2007 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 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 #ifndef T_NATFWSETTINGSPARSER_H
       
    23 #define T_NATFWSETTINGSPARSER_H
       
    24 
       
    25 
       
    26 #include <e32std.h>
       
    27 
       
    28 class CDesC8Array;
       
    29 
       
    30 
       
    31 /**
       
    32  *  Class handles natsettings data parsing operations
       
    33  *
       
    34  *  @lib natsettings.lib
       
    35  *  @since S60 v3.2
       
    36  */
       
    37 class TNATFWSettingsParser
       
    38     {
       
    39 
       
    40 public:
       
    41 
       
    42     /** 
       
    43      * Parse address and port from given descriptor.
       
    44      * Port is set to 0 and aData is returned, if port was not found.
       
    45      * Parser accept form "address:port"
       
    46      *
       
    47      * @since S60 3.2
       
    48      * @param aData Target descriptor
       
    49      * @param aPort Parsed port
       
    50      * @return Address
       
    51      */ 
       
    52     static HBufC8* ParseAddressL( const TDesC8& aData, TInt& aPort );
       
    53 
       
    54     /** 
       
    55      * Parse address and port from given descriptor.
       
    56      * Port is set to 0 and aData is returned, if port was not found.
       
    57      * Parser accept form "address:port".
       
    58      *
       
    59      * @since S60 3.2
       
    60      * @param aData Target descriptor
       
    61      *        It's form should be [ address:port ]
       
    62      * @param aPort Parsed port
       
    63      * @return Address. The pointer is also put onto the cleanup stack
       
    64      */ 
       
    65     static HBufC8* ParseAddressLC( const TDesC8& aData, TInt& aPort );
       
    66 
       
    67     /** 
       
    68      * Parse data to descriptor array from the given descriptor.
       
    69      * Parser accept form "protocol1,protocol2,...".
       
    70      *
       
    71      * @since S60 3.2
       
    72      * @param aData Target descriptor    
       
    73      * @return Descriptor array, ownership is transferred
       
    74      */
       
    75     static CDesC8Array* ParseDataToArrayL( const TDesC8& aData ); 
       
    76 
       
    77     };
       
    78 
       
    79 
       
    80 #endif // T_NATFWSETTINGSPARSER_H