![]() |
FLImaging 6.7.1.3
|
Implements a Trie structure for efficient string searching. More...
#include <Trie.h>
Public Member Functions | |
CTrie () | |
Default constructor. | |
CTrie (const CTrie &rhs) | |
Copy constructor for the CTrie class. | |
CTrie (const CTrie *pRhs) | |
Pointer-based copy constructor for the CTrie class. | |
virtual | ~CTrie () |
Destructor. | |
virtual const CResult | Assign (const CTrie &rhs) |
Assigns properties from another CTrie object using a reference. | |
virtual const CResult | Assign (const CTrie *pRhs) |
Assigns properties from another CTrie object using a pointer. | |
virtual const CResult | SetNodeTemplate (const CTrieNode *pTrieNodeTemplate) |
Sets the node template used for creating new nodes. | |
virtual const CTrieNode * | GetNodeTemplate () const |
Gets the current node template. | |
virtual CTrieNode * | Insert (const std::wstring &wstrWord) |
Inserts a word into the CTrie. | |
virtual const CResult | Remove (const std::wstring &wstrWord) |
Removes a word from the Trie. | |
virtual CTrieNode * | Rename (const std::wstring &wstrOldWord, const std::wstring &wstrNewWord) |
Edits an existing word in the Trie. | |
virtual bool | FindExact (const std::wstring &wstrWord) const |
Searches for an exact word. | |
virtual bool | FindSubstring (const std::wstring &wstrSubstring, std::vector< std::wstring > &vctResults) const |
Searches for words containing a given substring. | |
virtual const CResult | Clear () |
Clears all data in the Trie. | |
virtual const CTrieNode * | FindExactNode (const std::wstring &wstrWord) const |
Returns the node where the given word exactly matches. |
Protected Member Functions | |
virtual const CTrieNode * | FindNode (const std::wstring &wstrKey) const |
Finds a specific key in the Trie. | |
virtual bool | RemoveHelper (CTrieNode *pNode, const std::wstring &wstrWord, int32_t i32Depth) |
Recursively removes a word from the Trie. | |
virtual void | CollectWords (const CTrieNode *pNode, std::vector< std::wstring > &vctResults) const |
Collects all words ending at a given node. | |
virtual wchar_t | NormalizeChar (wchar_t ch) const |
Normalizes a character to handle case-insensitive search. |
Protected Attributes | |
CTrieNode * | m_pRoot |
CTrieNode * | m_pNodeTemplate |
Implements a Trie structure for efficient string searching.
A class that implements a Trie structure for efficient string searching.
FLImaging::Foundation::CTrie::CTrie | ( | const CTrie & | rhs | ) |
Copy constructor for the CTrie class.
[in] | rhs | Reference to the object to copy. |
FLImaging::Foundation::CTrie::CTrie | ( | const CTrie * | pRhs | ) |
Pointer-based copy constructor for the CTrie class.
[in] | pRhs | Pointer to the object to copy. |
Assigns properties from another CTrie object using a reference.
[in] | rhs | Reference to the object to copy properties from. |
const | FLImaging::CResult Result of the assignment operation. |
Assigns properties from another CTrie object using a pointer.
[in] | pRhs | Pointer to the object to copy properties from. |
const | FLImaging::CResult Result of the assignment operation. |
|
virtual |
Clears all data in the Trie.
FLImaging::CResult | The result of the clearing operation. |
|
protectedvirtual |
Collects all words ending at a given node.
[in] | pNode | The starting node. |
[out] | vctResults | A vector containing found words. |
|
virtual |
Searches for an exact word.
[in] | wstrWord | The word to search. |
bool | true If the word exists. false If the word does not exist. |
|
virtual |
Returns the node where the given word exactly matches.
[in] | wstrWord | The word to search. |
const | CTrieNode* The node that exactly matches the given word. |
|
protectedvirtual |
Finds a specific key in the Trie.
[in] | wstrKey | The key to search. |
FLImaging::Foundation::CTrieNode* | Pointer to the corresponding node (nullptr if not found). |
|
virtual |
Searches for words containing a given substring.
[in] | wstrSubstring | The substring to search for. |
[out] | vctResults | A vector containing found words. |
bool | true If matching words are found. false If no matches are found. |
|
virtual |
Gets the current node template.
const | CTrieNode* Pointer to the current node template. |
|
virtual |
Inserts a word into the CTrie.
[in] | wstrWord | The word to insert. |
CTrieNode* | The pointer to the inserted node. |
|
protectedvirtual |
Normalizes a character to handle case-insensitive search.
[in] | ch | The character to normalize. |
wchar_t | The normalized character. |
|
virtual |
Removes a word from the Trie.
[in] | wstrWord | The word to remove. |
const | FLImaging::CResult Result of the function. |
|
protectedvirtual |
Recursively removes a word from the Trie.
[in] | pNode | The current node being checked. |
[in] | wstrWord | The word to remove. |
[in] | i32Depth | The current depth in recursion. |
true | If the node should be deleted. |
|
virtual |
Edits an existing word in the Trie.
[in] | wstrOldWord | The word to be replaced. |
[in] | wstrNewWord | The new word to insert. |
CTrieNode* | The pointer to the newly inserted node. |
const | FLImaging::CResult Result of the function. |
|
virtual |
Sets the node template used for creating new nodes.
[in] | pTrieNodeTemplate | Pointer to the node template. |
|
protected |
The object that serves as a template for nodes. Default is CTrieNode.
|
protected |
Root node of the Trie.