summaryrefslogtreecommitdiff
path: root/include/svl
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2013-10-02 16:35:41 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2013-10-04 19:15:23 -0400
commit5f5876e5c395808006daef3456a961d9e6756791 (patch)
tree4695bbda72a078015f616ed36f54d1e923e3f940 /include/svl
parent46ca6ab1fe69a29b75c3b9c3a04af27b5af63fd3 (diff)
Add purge() method to purge unreferenced strings from the pool.
But this code needs more work. Change-Id: I538eebf5eb1738a2cfeebc22052b3d5db6001b6b
Diffstat (limited to 'include/svl')
-rw-r--r--include/svl/stringpool.hxx22
1 files changed, 21 insertions, 1 deletions
diff --git a/include/svl/stringpool.hxx b/include/svl/stringpool.hxx
index d2eca12e9609..cac7637d9a92 100644
--- a/include/svl/stringpool.hxx
+++ b/include/svl/stringpool.hxx
@@ -54,7 +54,8 @@ public:
/**
* Get a unique ID of string object that's expected to be in the shared
- * string pool. If the string is not in the pool, NULL is returned.
+ * string pool. If the string is not in the pool, NULL is returned. The
+ * ID obtained by this method can be used for case sensitive comparison.
*
* @param rStr string object to get the ID of.
*
@@ -62,8 +63,27 @@ public:
*/
StrIdType getIdentifier( const OUString& rStr ) const;
+ /**
+ * Get a unique ID of string object for case insensitive comparison. The
+ * string object is expected to be in the pool.
+ *
+ * @param rStr string object to get the ID of.
+ *
+ * @return unique ID of the string object usable for case insensitive
+ * comparison.
+ */
StrIdType getIdentifierIgnoreCase( const OUString& rStr ) const;
+ /**
+ * Go through all string objects in the pool, and clear those that are no
+ * longer used outside of the pool.
+ */
+ void purge();
+
+ size_t getCount() const;
+
+ size_t getCountIgnoreCase() const;
+
private:
InsertResultType findOrInsert( StrHashType& rPool, const OUString& rStr ) const;
};