Branch libreoffice-5-0-4
[LibreOffice.git] / include / svl / sharedstringpool.hxx
blobf44810b419c6e704c76c837ff5058fc5bd458222
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
10 #ifndef INCLUDED_SVL_SHAREDSTRINGPOOL_HXX
11 #define INCLUDED_SVL_SHAREDSTRINGPOOL_HXX
13 #include <svl/svldllapi.h>
14 #include <rtl/ustring.hxx>
16 class CharClass;
18 namespace svl {
20 class SharedString;
22 /**
23 * Storage for pool of shared strings. It also provides mapping from
24 * original-cased strings to upper-cased strings for case insensitive
25 * operations.
27 class SVL_DLLPUBLIC SharedStringPool
29 struct Impl;
30 Impl* mpImpl;
32 SharedStringPool( const SharedStringPool& ) SAL_DELETED_FUNCTION;
33 SharedStringPool& operator=( const SharedStringPool& ) SAL_DELETED_FUNCTION;
35 public:
36 SharedStringPool( const CharClass* pCharClass );
37 ~SharedStringPool();
39 /**
40 * Intern a string object into the shared string pool.
42 * @param rStr string object to intern.
44 * @return a pointer to the string object stored inside the pool, or NULL
45 * if the insertion fails.
47 SharedString intern( const OUString& rStr );
49 /**
50 * Go through all string objects in the pool, and clear those that are no
51 * longer used outside of the pool.
53 void purge();
55 size_t getCount() const;
57 size_t getCountIgnoreCase() const;
62 #endif
64 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */