1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/textandloc/textandlocutils/numbergrouping/inc/RegularExpression.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,65 @@
1.4 +/*
1.5 +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of the License "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description:
1.18 +*
1.19 +*
1.20 +*/
1.21 +
1.22 +
1.23 +
1.24 +#ifndef C_REGULAR_EXPRESSION_H
1.25 +#define C_REGULAR_EXPRESSION_H
1.26 +
1.27 +#include "StateMachine.h"
1.28 +
1.29 +NONSHARABLE_CLASS(CRegularExpression) : public CBase
1.30 +{
1.31 +public:
1.32 + static CRegularExpression* NewL(RPointerArray<TDesC>* aPatterns);
1.33 + static CRegularExpression* NewLC(RPointerArray<TDesC>* aPatterns);
1.34 + virtual ~CRegularExpression();
1.35 +
1.36 + TInt Search(const TDesC& aString);
1.37 + TInt SearchFrom(TInt aIndex, const TDesC& aString);
1.38 +
1.39 + /**
1.40 + * This routine writes into a client supplied descriptor a string that is a wildcarded version of
1.41 + * one of the pattern matches in the engine. The pattern(statemachine) at index aPattenIndex is used.
1.42 + *
1.43 + * It writes characters into the supplied descriptor to a length of the maximum number of
1.44 + * characters to match.
1.45 + *
1.46 + * For each character index, if there is only one possible valid character, it puts in that
1.47 + * character. If there are more than one, then the supplied aWildcard is written in.
1.48 + *
1.49 + * @param aPattenIndex The index of the pattern in the engine to use.
1.50 + * for the N patterns supplied at construction.
1.51 + * @param aWildcardChar The character to put in the example pattern if there is no single
1.52 + * valid character at that point
1.53 + * @param aWildcardedPattern Descriptor to write the wildcarded matching pattern into
1.54 + */
1.55 + void GetWildcardVersionOfPattern( TInt aPatternIndex, TText aWildcard, TDes& aWildcardedPattern) const;
1.56 +
1.57 +protected:
1.58 + CRegularExpression();
1.59 +
1.60 + void ConstructL(RPointerArray<TDesC>* aPatterns);
1.61 + virtual void GenerateStateTablesL(RPointerArray<TDesC>* aPatterns);
1.62 +
1.63 + RPointerArray<CStateMachine> iStateMachines;
1.64 +};
1.65 +
1.66 +#endif // C_REGULAR_EXPRESSION_H
1.67 +
1.68 +// End of File