xdmprotocols/XcapProtocol/XcapOperations/inc/XcapUriParser.h
branchGCC_SURGE
changeset 28 d9861ae9169c
parent 23 77cb48a03620
parent 26 04ca1926b01c
equal deleted inserted replaced
23:77cb48a03620 28:d9861ae9169c
     1 /*
       
     2 * Copyright (c) 2005 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:   CXcapUriParser
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef __XCAPURIPARSER__
       
    22 #define __XCAPURIPARSER__
       
    23 
       
    24 #include <e32base.h>
       
    25 #include "XcapDocumentNode.h"
       
    26 #include "XcapUriInterface.h"
       
    27 
       
    28 //Constants
       
    29 _LIT8( KXcapUriColon,                           ":" );
       
    30 _LIT8( KXcapUriQMark,                           "?" );
       
    31 _LIT8( KXcapUriXmlns,                           "xmlns(" );
       
    32 _LIT8( KXcapUriEquals,                          "=\"" );
       
    33 _LIT8( KXcapUriQuote,                           "\"" );
       
    34 _LIT8( KXcapParenthClose,                       ")" );
       
    35 
       
    36 class CXdmDocument;
       
    37 class CXdmDocumentNode;
       
    38 class CXcapOperationFactory;
       
    39 
       
    40 //CLASS DECLARATION
       
    41 NONSHARABLE_CLASS ( CXcapUriParser ) : public CBase, public MXcapUriInterface
       
    42     {
       
    43     public:
       
    44 
       
    45         /**
       
    46         * Destructor.
       
    47         */      
       
    48         static CXcapUriParser* NewL( CXdmDocument& aTargetDoc,
       
    49                                      CXcapOperationFactory& aOperationFactory );
       
    50         
       
    51         /**
       
    52         * Destructor.
       
    53         */      
       
    54         void SetDocumentSubset( const CXdmDocumentNode* aDocumentSubset );                          
       
    55         
       
    56         /**
       
    57         * Destructor.
       
    58         */      
       
    59         void ParseL( const TPtrC8& aHttpUri );
       
    60         
       
    61         /**
       
    62         * Destructor.
       
    63         */      
       
    64         TPtrC8 DesC8() const;
       
    65         
       
    66         /**
       
    67         * Destructor.
       
    68         */   
       
    69         TXdmElementType NodeType() const;
       
    70         
       
    71         /**
       
    72         * Destructor.
       
    73         */      
       
    74         virtual ~CXcapUriParser();
       
    75     
       
    76     private:  //From MXcapUriInterface
       
    77     
       
    78         /**
       
    79         * Add new namespace mapping
       
    80         * @param TDesC8& Namespace URI
       
    81         * @param TDesC8& Namespace prefix
       
    82         * @return void
       
    83         */      
       
    84         void AddNamespaceMappingL( const TDesC8& aUri, const TDesC8& aPrefix ); 
       
    85 
       
    86     private:  //Methods
       
    87         
       
    88         /**
       
    89         * Symbian OS default constructor.
       
    90         * @param TInt Default Access Point ID
       
    91         * @return CXdmDocOperation*
       
    92         */     
       
    93         CXcapUriParser( CXdmDocument& aTargetDoc,
       
    94                         CXcapOperationFactory& aOperationFactory );
       
    95         
       
    96         /**
       
    97         * Symbian OS default constructor.
       
    98         * @param TInt Default Access Point ID
       
    99         * @return CXdmDocOperation*
       
   100         */     
       
   101         void ConstructL();
       
   102         
       
   103         /**
       
   104         * Symbian OS default constructor.
       
   105         * @param TInt Default Access Point ID
       
   106         * @return CXcapDocOperation*
       
   107         */   
       
   108         TInt CreateBasicNodeUriL( HBufC8* aNodePath );
       
   109         
       
   110         /**
       
   111         * Symbian OS default constructor.
       
   112         * @param TInt Default Access Point ID
       
   113         * @return CXcapDocOperation*
       
   114         */   
       
   115         HBufC8* DocSubsetPathL();
       
   116 
       
   117         /**
       
   118         * Symbian OS default constructor.
       
   119         * @param TInt Default Access Point ID
       
   120         * @return CXcapDocOperation*
       
   121         */   
       
   122         void AppendPredicatesL( TInt& aPosition,
       
   123                                 CBufBase* aBuffer,
       
   124                                 const CXdmDocumentNode* aPathElement );
       
   125         
       
   126         /**
       
   127         * Symbian OS default constructor.
       
   128         * @param TInt Default Access Point ID
       
   129         * @return CXcapDocOperation*
       
   130         */   
       
   131         HBufC8* FormatOnePathElementLC( const CXdmDocumentNode* aPathElement );
       
   132         
       
   133         /**
       
   134         * Symbian OS default constructor.
       
   135         * @param TInt Default Access Point ID
       
   136         * @return CXcapDocOperation*
       
   137         */   
       
   138         void FormatAttributeUriL();
       
   139         
       
   140         /**
       
   141         * Symbian OS default constructor.
       
   142         * @param TInt Default Access Point ID
       
   143         * @return CXcapDocOperation*
       
   144         */   
       
   145         void FormatNodeUriL();
       
   146         
       
   147         /**
       
   148         * Symbian OS default constructor.
       
   149         * @param TInt Default Access Point ID
       
   150         * @return CXcapDocOperation*
       
   151         */   
       
   152         void AppendNamespaceMappingsL();
       
   153         
       
   154         /**
       
   155         * Symbian OS default constructor.
       
   156         * @param TInt Default Access Point ID
       
   157         * @return CXcapDocOperation*
       
   158         */     
       
   159         void FinaliseL();
       
   160         
       
   161     #ifdef _DEBUG
       
   162     
       
   163         /**
       
   164         * Symbian OS default constructor.
       
   165         * @param TInt Default Access Point ID
       
   166         * @return CXcapDocOperation*
       
   167         */   
       
   168         void DumpUriL( HBufC8* aNodePath ); 
       
   169     
       
   170     #endif
       
   171 
       
   172     private:  //Data
       
   173         
       
   174         TInt                                 iBufferPosition;
       
   175         TPtrC8*                              iHttpUri;
       
   176         HBufC8*                              iCompleteUri;
       
   177         CBufFlat*                            iUriBuffer;
       
   178         CXdmDocument&                        iTargetDoc;
       
   179         TXdmElementType                      iNodeType;
       
   180         CXdmDocumentNode*                    iDocumentSubset;
       
   181         CXcapOperationFactory&               iOperationFactory;
       
   182         RPointerArray<CXdmNamespace>         iNamespaceMappings;
       
   183     };
       
   184 
       
   185 #endif      //__XCAPURIPARSER__
       
   186             
       
   187 // End of File