2013-06-11 23:13:14 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*/
|
|
|
|
|
2013-10-23 19:17:57 +02:00
|
|
|
#ifndef INCLUDED_EDITENG_TRIE_HXX
|
|
|
|
#define INCLUDED_EDITENG_TRIE_HXX
|
2013-06-11 23:13:14 +02:00
|
|
|
|
|
|
|
#include <sal/types.h>
|
|
|
|
#include <rtl/ustring.hxx>
|
|
|
|
#include <editeng/editengdllapi.h>
|
2015-02-15 20:41:33 +00:00
|
|
|
#include <memory>
|
|
|
|
#include <vector>
|
2013-06-11 23:13:14 +02:00
|
|
|
|
|
|
|
namespace editeng
|
|
|
|
{
|
|
|
|
|
2013-06-22 18:54:16 +02:00
|
|
|
struct TrieNode;
|
2013-06-11 23:13:14 +02:00
|
|
|
|
|
|
|
class EDITENG_DLLPUBLIC Trie
|
|
|
|
{
|
|
|
|
private:
|
2015-02-15 20:41:33 +00:00
|
|
|
std::unique_ptr<TrieNode> mRoot;
|
2013-06-11 23:13:14 +02:00
|
|
|
|
|
|
|
public:
|
|
|
|
Trie();
|
|
|
|
virtual ~Trie();
|
|
|
|
|
2014-03-14 11:36:22 +02:00
|
|
|
void insert(const OUString& sInputString) const;
|
|
|
|
void findSuggestions(const OUString& sWordPart, std::vector<OUString>& rSuggestionList) const;
|
2014-02-02 15:02:36 +01:00
|
|
|
void getAllEntries(std::vector<OUString>& entries);
|
2013-06-11 23:13:14 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2013-10-23 19:17:57 +02:00
|
|
|
#endif // INCLUDED_EDITENG_TRIE_HXX
|
2013-06-11 23:13:14 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|