summaryrefslogtreecommitdiff
path: root/sax/inc
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2008-01-10 11:51:06 +0000
committerOliver Bolte <obo@openoffice.org>2008-01-10 11:51:06 +0000
commit01a06ba006b2f3d76d0faa5f9e068385bae08da5 (patch)
tree72f0b0815528cad9def054f8c5497e3aeef4ed71 /sax/inc
parent63b00474079a4f610a64a03a21ca50b3b27dea91 (diff)
INTEGRATION: CWS xmlfilter02 (1.1.2); FILE ADDED
2006/05/10 15:39:50 cl 1.1.2.4: added comments, using OString for attributes 2006/05/08 14:25:57 cl 1.1.2.3: new token based sax implementation 2006/02/20 14:45:48 cl 1.1.2.2: added missing newline at end of file 2006/02/14 18:40:53 cl 1.1.2.1: added initial libxml2 wrapper
Diffstat (limited to 'sax/inc')
-rw-r--r--sax/inc/sax/tools/tokenmap.hxx84
1 files changed, 84 insertions, 0 deletions
diff --git a/sax/inc/sax/tools/tokenmap.hxx b/sax/inc/sax/tools/tokenmap.hxx
new file mode 100644
index 000000000000..9f30fffa3d91
--- /dev/null
+++ b/sax/inc/sax/tools/tokenmap.hxx
@@ -0,0 +1,84 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: tokenmap.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: obo $ $Date: 2008-01-10 12:51:06 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * 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., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _SAX_TOKENMAP_HXX_
+#define _SAX_TOKENMAP_HXX_
+
+#ifndef _RTL_REF_HXX_
+#include <rtl/ref.hxx>
+#endif
+
+#ifndef _RTL_USTRING_HXX_
+#include <rtl/ustring.hxx>
+#endif
+
+#ifndef INCLUDED_SAX_DLLAPI_H
+#include "sax/dllapi.h"
+#endif
+
+#ifndef _SAX_OBJECT_HXX_
+#include "sax/tools/saxobject.hxx"
+#endif
+
+namespace sax
+{
+ /** type for a token identifier */
+ typedef sal_uInt32 SaxToken;
+
+ /** this class maps a set of ascii/utf-8 strings to token identifier */
+ class SAX_DLLPUBLIC SaxTokenMap : public SaxObject
+ {
+ public:
+ /** constant do indicate an unknown token */
+ const static SaxToken InvalidToken = (SaxToken)-1;
+
+ /** returns the token identifier for the given ascii string or SaxTokenMap::InvalidToken */
+ virtual SaxToken GetToken( const sal_Char* pChar, sal_uInt32 nLength = 0 ) const = 0;
+
+ /** returns the token identifier for the given unicode string or SaxTokenMap::InvalidToken */
+ virtual SaxToken GetToken( const ::rtl::OUString& rToken ) const = 0;
+
+ /** returns the unicode string for the given token identifier */
+ virtual const ::rtl::OUString& GetToken( SaxToken nToken ) const = 0;
+
+ /** returns if the given unicode string equals the given token identifier */
+ bool IsToken( const ::rtl::OUString& rToken, SaxToken nToken ) const { return GetToken( rToken ) == nToken; }
+ };
+
+ /** reference type to a SaxTokenMap */
+ typedef rtl::Reference< SaxTokenMap > SaxTokenMapRef;
+}
+
+#endif // _SAX_TOKENMAP_HXX_