diff -r 000000000000 -r bde4ae8d615e os/textandloc/textandlocutils/numbergrouping/inc/RegularExpression.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/os/textandloc/textandlocutils/numbergrouping/inc/RegularExpression.h Fri Jun 15 03:10:57 2012 +0200 @@ -0,0 +1,65 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +* +*/ + + + +#ifndef C_REGULAR_EXPRESSION_H +#define C_REGULAR_EXPRESSION_H + +#include "StateMachine.h" + +NONSHARABLE_CLASS(CRegularExpression) : public CBase +{ +public: + static CRegularExpression* NewL(RPointerArray* aPatterns); + static CRegularExpression* NewLC(RPointerArray* aPatterns); + virtual ~CRegularExpression(); + + TInt Search(const TDesC& aString); + TInt SearchFrom(TInt aIndex, const TDesC& aString); + + /** + * This routine writes into a client supplied descriptor a string that is a wildcarded version of + * one of the pattern matches in the engine. The pattern(statemachine) at index aPattenIndex is used. + * + * It writes characters into the supplied descriptor to a length of the maximum number of + * characters to match. + * + * For each character index, if there is only one possible valid character, it puts in that + * character. If there are more than one, then the supplied aWildcard is written in. + * + * @param aPattenIndex The index of the pattern in the engine to use. + * for the N patterns supplied at construction. + * @param aWildcardChar The character to put in the example pattern if there is no single + * valid character at that point + * @param aWildcardedPattern Descriptor to write the wildcarded matching pattern into + */ + void GetWildcardVersionOfPattern( TInt aPatternIndex, TText aWildcard, TDes& aWildcardedPattern) const; + +protected: + CRegularExpression(); + + void ConstructL(RPointerArray* aPatterns); + virtual void GenerateStateTablesL(RPointerArray* aPatterns); + + RPointerArray iStateMachines; +}; + +#endif // C_REGULAR_EXPRESSION_H + +// End of File