williamr@2: // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: // All rights reserved. williamr@2: // This component and the accompanying materials are made available williamr@4: // under the terms of "Eclipse Public License v1.0" williamr@2: // which accompanies this distribution, and is available williamr@4: // at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@2: // williamr@2: // Initial Contributors: williamr@2: // Nokia Corporation - initial contribution. williamr@2: // williamr@2: // Contributors: williamr@2: // williamr@2: // Description: williamr@2: // williamr@2: williamr@2: #ifndef __DELIMITEDPATH8_H__ williamr@2: #define __DELIMITEDPATH8_H__ williamr@2: williamr@2: /** williamr@2: @file DelimitedPath8.h williamr@2: Comments : This file contains the API definition for the classes williamr@2: TDelimitedPathParser8 and CDelimitedPath16. williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: williamr@2: // System includes williamr@2: // williamr@2: #include williamr@2: #include williamr@2: williamr@2: williamr@2: /** williamr@2: Dependencies : TDelimitedParserBase8 williamr@2: Comments : Derived class from TDelimitedParserBase providing a class for parsing williamr@2: paths delimited by a '/' as defined in RFC2396. williamr@2: @publishedAll williamr@2: @released williamr@2: @since 6.0 williamr@2: */ williamr@2: class TDelimitedPathParser8 : public TDelimitedParserBase8 williamr@2: { williamr@2: public: // Methods williamr@2: williamr@2: IMPORT_C TDelimitedPathParser8(); williamr@2: williamr@2: IMPORT_C void Parse(const TDesC8& aPath); williamr@2: williamr@2: IMPORT_C void ParseReverse(const TDesC8& aPath); williamr@2: }; williamr@2: williamr@2: /** williamr@2: Dependencies : CDelimitedStringBase8 williamr@2: Comments : Provides functionality to create a delimited path where components of the williamr@2: path delimited by '/' as defined in RFC2396. williamr@2: @publishedAll williamr@2: @released williamr@2: @since 6.0 williamr@2: */ williamr@2: class CDelimitedPath8 : public CDelimitedDataBase8 williamr@2: { williamr@2: public: // Methods williamr@2: williamr@2: /** williamr@2: Static factory constructor. Uses two phase construction and leaves nothing williamr@2: on the CleanupStack. williamr@2: @since 6.0 williamr@2: @param aPath A descriptor with the initial path. williamr@2: @return A pointer to created object. williamr@2: @post Nothing left on the CleanupStack. williamr@2: */ williamr@2: IMPORT_C static CDelimitedPath8* NewL(const TDesC8& aPath); williamr@2: williamr@2: /** williamr@2: Static factory constructor. Uses two phase construction and leaves a williamr@2: pointer to created object on the CleanupStack. williamr@2: @since 6.0 williamr@2: @param aPath A descriptor with the initial path. williamr@2: @return A pointer to created object. williamr@2: @post Pointer to created object left of CleanupStack. williamr@2: */ williamr@2: IMPORT_C static CDelimitedPath8* NewLC(const TDesC8& aPath); williamr@2: williamr@2: /** williamr@2: Destructor. williamr@2: @since 6.0 williamr@2: */ williamr@2: IMPORT_C ~CDelimitedPath8(); williamr@2: williamr@2: /** williamr@2: Escape encodes the segment then inserts the escaped version in a williamr@2: position before the current parsed segment. The new segment should only contain a williamr@2: single path segment, as any path delimiters in the segment will be converted to an williamr@2: escape triple. The parser is left in a state where its current segment is the same williamr@2: one as before the insertion. williamr@2: @since 6.0 williamr@2: @param aSegment A descriptor with the unescaped path segment. williamr@2: @pre The path must have been initially parsed. williamr@2: @post The path will have been extended to include the new segment. The williamr@2: current segment will remain as the one before the insertion. williamr@2: */ williamr@2: IMPORT_C void InsertAndEscapeCurrentL(const TDesC8& aSegment); williamr@2: williamr@2: /** williamr@2: Escape encodes the segment then inserts the escaped version at williamr@2: the front of the path. The new segment should only contain a single path segment, williamr@2: as any path delimiters in the segment will be converted to an escape triple. The williamr@2: parser is left in a state where its current segment is the same one as before williamr@2: the insertion. williamr@2: @warning A re-parse is required to ensure that the parser is valid. williamr@2: @since 6.0 williamr@2: @param aSegment A descriptor with the unescaped path segment. williamr@2: @pre The delimiter must have been set. williamr@2: @post The path will have been extended to include the new segment. williamr@2: */ williamr@2: IMPORT_C void PushAndEscapeFrontL(const TDesC8& aSegment); williamr@2: williamr@2: /** williamr@2: Escape encodes the segment then inserts the escaped version at williamr@2: the back of the path. The new segment should only contain a single path segment, williamr@2: as any path delimiters in the segment will be converted to an escape triple. The williamr@2: parser is left in a state where its current segment is the same one as before williamr@2: the insertion. williamr@2: @warning A re-parse is required to ensure that the parser is valid. williamr@2: @since 6.0 williamr@2: @param aSegment A descriptor with the unescaped path segment. williamr@2: @pre The delimiter must have been set. williamr@2: @post The path will have been extended to include the new segment. williamr@2: */ williamr@2: IMPORT_C void PushAndEscapeBackL(const TDesC8& aSegment); williamr@2: williamr@2: private: // Methods williamr@2: williamr@2: /** williamr@2: Constructor. First phase of two-phase construction method. Does williamr@2: non-allocating construction. williamr@2: @since 6.0 williamr@2: */ williamr@2: CDelimitedPath8(); williamr@2: williamr@2: /** williamr@2: Second phase of two-phase construction method. Does any allocations required williamr@2: to fully construct the object. williamr@2: @since 6.0 williamr@2: @param aPath A descriptor with the initial path. williamr@2: @pre First phase of construction is complete. williamr@2: @post The object is fully constructed. williamr@2: */ williamr@2: void ConstructL(const TDesC8& aPath); williamr@2: williamr@2: }; williamr@2: williamr@2: #endif // __DELIMITEDPATH8_H__