summaryrefslogtreecommitdiffstats
path: root/src/triestring.h
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-17 00:54:13 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-17 00:54:13 +0000
commit092be7678b67552cb3161fe162242bf8d3aeed2f (patch)
treebe0693f45b101252c370e40f6e84da2cd7a52f75 /src/triestring.h
downloadkmplayer-092be7678b67552cb3161fe162242bf8d3aeed2f.tar.gz
kmplayer-092be7678b67552cb3161fe162242bf8d3aeed2f.zip
Added old abandoned KDE3 version of kmplayer
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kmplayer@1091557 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/triestring.h')
-rw-r--r--src/triestring.h103
1 files changed, 103 insertions, 0 deletions
diff --git a/src/triestring.h b/src/triestring.h
new file mode 100644
index 0000000..84916d4
--- /dev/null
+++ b/src/triestring.h
@@ -0,0 +1,103 @@
+/**
+ This file belong to the KMPlayer project, a movie player plugin for Konqueror
+ Copyright (C) 2007 Koos Vriezen <koos.vriezen@gmail.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+**/
+
+#ifndef _TRIE_STRING_H_
+#define _TRIE_STRING_H_
+
+#include <qstring.h>
+
+namespace KMPlayer {
+
+class TrieNode;
+
+class KMPLAYER_EXPORT TrieString {
+ TrieNode * node;
+ friend bool operator == (const TrieString & s1, const TrieString & s2);
+ friend bool operator == (const TrieString & s, const char * utf8);
+ friend bool operator == (const char * utf8, const TrieString & s);
+ friend bool operator != (const TrieString & s1, const TrieString & s2);
+public:
+ TrieString ();
+ TrieString (const QString & s);
+ TrieString (const char * utf8);
+ TrieString (const TrieString & s);
+ ~TrieString ();
+
+ QString toString () const;
+ bool isNull () const;
+ void clear ();
+ bool startsWith (const TrieString & s) const;
+ bool startsWith (const char * str) const;
+ TrieString & operator = (const TrieString & s);
+ TrieString & operator = (const char * utf8);
+ bool operator < (const TrieString & s) const;
+};
+
+inline TrieString::TrieString () : node (0L) {}
+
+class KMPLAYER_EXPORT StringPool {
+public:
+ static void init();
+ static void reset();
+
+ static TrieString attr_id;
+ static TrieString attr_name;
+ static TrieString attr_src;
+ static TrieString attr_url;
+ static TrieString attr_href;
+ static TrieString attr_width;
+ static TrieString attr_height;
+ static TrieString attr_top;
+ static TrieString attr_left;
+ static TrieString attr_bottom;
+ static TrieString attr_right;
+ static TrieString attr_title;
+ static TrieString attr_begin;
+ static TrieString attr_dur;
+ static TrieString attr_end;
+ static TrieString attr_region;
+ static TrieString attr_target;
+ static TrieString attr_type;
+ static TrieString attr_value;
+ static TrieString attr_fill;
+};
+
+inline bool TrieString::isNull () const {
+ return !node;
+}
+
+inline bool operator == (const TrieString & s1, const TrieString & s2) {
+ return s1.node == s2.node;
+}
+
+bool operator == (const TrieString & s, const char * utf8);
+
+inline bool operator == (const char * utf8, const TrieString & s) {
+ return s == utf8;
+}
+
+inline bool operator != (const TrieString & s1, const TrieString & s2) {
+ return s1.node != s2.node;
+}
+
+void dumpTrie ();
+
+} // namespace
+
+#endif // _TRIE_STRING_H_