libraries/ltkutils/src/bsymtree.h
changeset 0 7f656887cf89
equal deleted inserted replaced
-1:000000000000 0:7f656887cf89
       
     1 // bsymtree.h
       
     2 // 
       
     3 // Copyright (c) 2010 Accenture. All rights reserved.
       
     4 // This component and the accompanying materials are made available
       
     5 // under the terms of the "Eclipse Public License v1.0"
       
     6 // which accompanies this distribution, and is available
       
     7 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 // 
       
     9 // Initial Contributors:
       
    10 // Accenture - Initial contribution
       
    11 //
       
    12 #ifndef FSHELL_BSYMTREE_H
       
    13 #define FSHELL_BSYMTREE_H
       
    14 
       
    15 #include <e32std.h>
       
    16 class CDesC16Array;
       
    17 
       
    18 namespace LtkUtils
       
    19 	{
       
    20 	class RLtkBuf16;
       
    21 
       
    22 	class RNode
       
    23 		{
       
    24 	public:
       
    25 		static RNode* NewL();
       
    26 		void InsertStringL(const TUint16* aString, TInt aValue=0);
       
    27 		~RNode();
       
    28 		void CompleteL(TDes& aPrefix, CDesC16Array& aResults);
       
    29 		TInt ValueForStringL(const TDesC& aString) const;
       
    30 
       
    31 	private:
       
    32 		RNode* ChildForLetter(char aChild) const;
       
    33 		RNode* AddChildL(char aChild);
       
    34 		RNode(char aLetter);
       
    35 		RNode* Sprog() const;
       
    36 		RArray<RNode*>& Sprogs() const;
       
    37 		RNode* WalkToEndOfString(TUint16*& aString);
       
    38 		RNode* TabFill(TUint16*& aString, const TUint16* aEnd);
       
    39 		void DoCompleteOptionsL(CDesC16Array& aResults, RLtkBuf16& aCurrent);
       
    40 		//void Dump() const; // Debug
       
    41 
       
    42 	private:
       
    43 		char iLetter;
       
    44 		char iHasChildArray;
       
    45 		short iPad;
       
    46 		TAny* iPtr; // Either an RNode* or an RArray<RNode*>*. Or a TInt for the value if (iLetter == 0 && !iHasChildArray)
       
    47 		};
       
    48 
       
    49 	}
       
    50 
       
    51 #endif