genericservices/httputils/inc/DelimitedPath8.h
changeset 0 e4d67989cc36
equal deleted inserted replaced
-1:000000000000 0:e4d67989cc36
       
     1 // Copyright (c) 2001-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".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef __DELIMITEDPATH8_H__
       
    17 #define __DELIMITEDPATH8_H__
       
    18 
       
    19 /**
       
    20 	@file DelimitedPath8.h
       
    21 	Comments :	This file contains the API definition for the classes 
       
    22 				TDelimitedPathParser8 and CDelimitedPath16. 
       
    23 	@publishedAll
       
    24 	@released	
       
    25  */
       
    26 
       
    27 // System includes
       
    28 //
       
    29 #include <e32base.h>
       
    30 #include <delimitedparser8.h>
       
    31 
       
    32 
       
    33 /**
       
    34 Dependencies : TDelimitedParserBase8
       
    35 Comments : Derived class from TDelimitedParserBase providing a class for parsing 
       
    36 paths delimited by a '/' as defined in RFC2396.
       
    37 @publishedAll
       
    38 @released
       
    39 @since 6.0
       
    40 */
       
    41 class TDelimitedPathParser8 : public TDelimitedParserBase8
       
    42 	{
       
    43 public:	// Methods
       
    44 
       
    45 	IMPORT_C TDelimitedPathParser8();
       
    46 
       
    47 	IMPORT_C void Parse(const TDesC8& aPath);
       
    48 
       
    49 	IMPORT_C void ParseReverse(const TDesC8& aPath);
       
    50 	};
       
    51 
       
    52 /**
       
    53 Dependencies : CDelimitedStringBase8
       
    54 Comments : Provides functionality to create a delimited path where components of the 
       
    55 path delimited by '/' as defined in RFC2396.
       
    56 @publishedAll
       
    57 @released
       
    58 @since 6.0
       
    59 */
       
    60 class CDelimitedPath8 : public CDelimitedDataBase8
       
    61 	{
       
    62 public:	// Methods
       
    63 
       
    64 /**
       
    65 	Static factory constructor. Uses two phase construction and leaves nothing
       
    66 	on the CleanupStack.
       
    67 	@since			6.0
       
    68 	@param			aPath	A descriptor with the initial path.
       
    69 	@return			A pointer to created object.
       
    70 	@post			Nothing left on the CleanupStack.
       
    71  */
       
    72 	IMPORT_C static CDelimitedPath8* NewL(const TDesC8& aPath);
       
    73 
       
    74 /**
       
    75 	Static factory constructor. Uses two phase construction and leaves a
       
    76 	pointer to created object on the CleanupStack.
       
    77 	@since			6.0
       
    78 	@param			aPath	A descriptor with the initial path.
       
    79 	@return			A pointer to created object.
       
    80 	@post			Pointer to created object left of CleanupStack.
       
    81  */
       
    82 	IMPORT_C static CDelimitedPath8* NewLC(const TDesC8& aPath);
       
    83 
       
    84 /**
       
    85 	Destructor.
       
    86 	@since			6.0
       
    87  */
       
    88 	IMPORT_C ~CDelimitedPath8();
       
    89 
       
    90 /**
       
    91 	Escape encodes the segment then inserts the escaped version in a 
       
    92 	position before the current parsed segment. The new segment should only contain a
       
    93 	single path segment, as any path delimiters in the segment will be converted to an
       
    94 	escape triple. The parser is left in a state where its current segment is the same
       
    95 	one as before the insertion.
       
    96 	@since			6.0
       
    97 	@param			aSegment	A descriptor with the unescaped path segment.
       
    98 	@pre 			The path must have been initially parsed.
       
    99 	@post			The path will have been extended to include the new segment. The 
       
   100 	current segment will remain as the one before the insertion.
       
   101  */
       
   102 	IMPORT_C void InsertAndEscapeCurrentL(const TDesC8& aSegment);
       
   103 
       
   104 /**
       
   105 	Escape encodes the segment then inserts the escaped version at 
       
   106 	the front of the path. The new segment should only contain a single path segment, 
       
   107 	as any path delimiters in the segment will be converted to an escape triple. The 
       
   108 	parser is left in a state where its current segment is the same one as before 
       
   109 	the insertion.
       
   110 	@warning		A re-parse is required to ensure that the parser is valid.
       
   111 	@since			6.0
       
   112 	@param			aSegment	A descriptor with the unescaped path segment.
       
   113 	@pre 			The delimiter must have been set. 
       
   114 	@post			The path will have been extended to include the new segment.
       
   115  */
       
   116 	IMPORT_C void PushAndEscapeFrontL(const TDesC8& aSegment);
       
   117 
       
   118 /**
       
   119 	Escape encodes the segment then inserts the escaped version at 
       
   120 	the back of the path. The new segment should only contain a single path segment, 
       
   121 	as any path delimiters in the segment will be converted to an escape triple. The 
       
   122 	parser is left in a state where its current segment is the same one as before 
       
   123 	the insertion.
       
   124 	@warning		A re-parse is required to ensure that the parser is valid.
       
   125 	@since			6.0
       
   126 	@param			aSegment	A descriptor with the unescaped path segment.
       
   127 	@pre 			The delimiter must have been set. 
       
   128 	@post			The path will have been extended to include the new segment.
       
   129  */
       
   130 	IMPORT_C void PushAndEscapeBackL(const TDesC8& aSegment);
       
   131 
       
   132 private:	// Methods
       
   133 
       
   134 /**
       
   135 	Constructor. First phase of two-phase construction method. Does
       
   136 	non-allocating construction.
       
   137 	@since			6.0
       
   138  */
       
   139 	CDelimitedPath8();
       
   140 
       
   141 /**
       
   142 	Second phase of two-phase construction method. Does any allocations required
       
   143 	to fully construct the object.
       
   144 	@since			6.0
       
   145 	@param			aPath	A descriptor with the initial path.
       
   146 	@pre 			First phase of construction is complete.
       
   147 	@post			The object is fully constructed.
       
   148  */
       
   149 	void ConstructL(const TDesC8& aPath);
       
   150 
       
   151 	};
       
   152 
       
   153 #endif	// __DELIMITEDPATH8_H__