Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // This file contains the API definition for the classes TDelimitedParserBase8
15 // and CDelimitedData8.
22 @file DelimitedParser8.h
27 #ifndef __DELIMITEDPARSER8_H__
28 #define __DELIMITEDPARSER8_H__
33 #include <delimitedparsercommon.h>
37 Comments : Provides non-modifying functionality for parsing data delimited by
38 a single character. The data is delimited into segments. Uses 8-bit descriptors.
40 The object contains a descriptor with the data which can be parsed from left
41 to right, or right to left. It is non-owning. The current segment can be extracted,
42 which then parses the string for the next segment.
44 This is a base class and an object of this type cannot be instantiated. It should
45 be derived. The derived class should ensure that the data iDataDes is set before
46 calling one of the protected parsing functions. The derived class should also ensure
47 that the delimiting character has been set.
49 If the data iDataDes has not been parsed, then calling any functionality that
50 requires the data to have been parsed will result in a panic
51 KDelimitedParserErrNotParsed. The data can only be parsed by calling one of the
52 protected parsing functions from the derived class.
54 If the delimiting character iDelimiter has not been set, then calling the protected
55 parsing functions and some of the other public functionality that requires the
56 delimiter to be set will result in a panic KDelimitingParserErrNoDelimiter.
61 class TDelimitedParserBase8
65 IMPORT_C void Reset() const;
67 IMPORT_C TInt GetNext(TPtrC8& aSegment) const;
69 IMPORT_C TInt Inc() const;
71 IMPORT_C TInt Dec() const;
73 IMPORT_C TInt Peek(TPtrC8& aSegment) const;
75 IMPORT_C TBool Eos() const;
77 IMPORT_C TBool FrontDelimiter() const;
79 IMPORT_C TBool BackDelimiter() const;
81 IMPORT_C const TDesC8& Des() const;
83 IMPORT_C TInt Remainder(TPtrC8& aRemainder) const;
87 IMPORT_C TDelimitedParserBase8();
89 IMPORT_C void Parse(const TDesC8& aData);
91 IMPORT_C void ParseReverse(const TDesC8& aData);
93 IMPORT_C void SetDelimiter(TChar aDelimiter);
97 void DoParse(const TDesC8& aData);
99 TInt FindNextSegment(TInt aStartPos) const;
101 TInt FindPrevSegment(TInt aStartPos) const;
103 private: // Attributes
105 /** Descriptor with the string
109 /** Descriptor with the current segment.
111 mutable TPtrC8 iCurrentSegment;
113 /** Position of next segment.
115 mutable TInt iNextSegmentPos;
117 /** Direction of parsing.
119 TDelimitedDataParseMode iMode;
121 /** Delimiting character
127 @see CDelimitedDataBase8
130 friend class CDelimitedDataBase8;
135 Dependencies : CBase, TDelimitedParserBase8
136 Comments : Provides functionality for creating and editing a delimited data object.
137 Uses 8-bit descriptors
139 The object contains a descriptor buffer with the data. Functionality is provided
140 to allow segments to be added or removed from the data. There is access to the
141 internal delimited data parser to provide parsing functionality to be excercised
144 This a base class that cannot be instantiated. It should be derived. The derived
145 class must set the delimited data parser, which is an object derived from
146 TDelimitedParserBase. This helper class must set the delimiting object
148 If the delimiting character has not been set, then calling any of the functionality
149 will cause a panic KDelimitedParserErrNoDelimiter.
154 class CDelimitedDataBase8 : public CBase
158 IMPORT_C ~CDelimitedDataBase8();
160 IMPORT_C void InsertCurrentL(const TDesC8& aSegment);
162 IMPORT_C void RemoveCurrentL();
164 IMPORT_C void PushBackL(const TDesC8& aSegment);
166 IMPORT_C void PopBackL();
168 IMPORT_C void PushFrontL(const TDesC8& aSegment);
170 IMPORT_C void PopFrontL();
172 IMPORT_C void TrimFrontDelimiterL();
174 IMPORT_C void AddFrontDelimiterL();
176 IMPORT_C void TrimBackDelimiterL();
178 IMPORT_C void AddBackDelimiterL();
180 IMPORT_C void Parse();
182 IMPORT_C void ParseReverse();
184 IMPORT_C const TDelimitedParserBase8& Parser() const;
186 protected: // Methods
188 IMPORT_C CDelimitedDataBase8();
190 IMPORT_C void ConstructL(const TDesC8& aData);
192 IMPORT_C void SetDelimiter(TChar aDelimiter);
197 void SetDataL(const TDesC8& aData);
199 void SetData(HBufC8* aDataBuf);
201 void DoInsertL(const TDesC8& aSegment);
205 private: // Attributes
207 /** Descriptor buffer.
213 TDelimitedParserBase8 iParser;
217 #endif // __DELIMITEDPARSER8_H__