/ucpp/

distro/CN/libreoffice-7-4-LTS LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2007-04-11 19:21:48 +0000
committerVladimir Glazounov <vg@openoffice.org>2007-04-11 19:21:48 +0000
commit8cbd18c78de9cef746f32192d748fdfc0420f8c1 (patch)
tree34b8d4bb8da8fd806fa3107318c2f9c5dae875d6
parent2056a66a3a9e075242be9aa3533cc580573a3de6 (diff)
INTEGRATION: CWS hedaburemove01 (1.1.2); FILE ADDED
2006/12/12 16:25:00 vg 1.1.2.1: #i72503# gathered global includes in one place
Diffstat
-rw-r--r--tools/inc/tools/wldcrd.hxx110
-rw-r--r--tools/inc/tools/zcodec.hxx141
2 files changed, 251 insertions, 0 deletions
diff --git a/tools/inc/tools/wldcrd.hxx b/tools/inc/tools/wldcrd.hxx
new file mode 100644
index 000000000000..bd2dcad5d4b6
--- /dev/null
+++ b/tools/inc/tools/wldcrd.hxx
@@ -0,0 +1,110 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: wldcrd.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: vg $ $Date: 2007-04-11 20:21:37 $
+ *
+ * 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 _WLDCRD_HXX
+#define _WLDCRD_HXX
+
+#ifndef INCLUDED_TOOLSDLLAPI_H
+#include "tools/toolsdllapi.h"
+#endif
+
+#ifndef _SOLAR_H
+#include <tools/solar.h>
+#endif
+
+#ifndef _STRING_HXX
+#include <tools/string.hxx>
+#endif
+
+#ifndef _OSL_THREAD_H_
+#include <osl/thread.h>
+#endif
+
+// ------------
+// - WildCard -
+// ------------
+
+class TOOLS_DLLPUBLIC WildCard
+{
+private:
+ ByteString aWildString;
+ char cSepSymbol;
+
+ USHORT ImpMatch( const char *pWild, const char *pStr ) const;
+
+public:
+ WildCard();
+ WildCard( const String& rWildCards,
+ const char cSeparator = '\0' );
+
+ const String GetWildCard() const { return UniString( aWildString, osl_getThreadTextEncoding()); }
+ const String operator ()() const { return UniString( aWildString, osl_getThreadTextEncoding()); }
+
+ BOOL Matches( const String& rStr ) const;
+
+ BOOL operator ==( const String& rString ) const
+ { return Matches( rString ); }
+ BOOL operator !=( const String& rString ) const
+ { return !( Matches( rString ) ); }
+
+ WildCard& operator =( const String& rString );
+ WildCard& operator =( const WildCard& rWildCard );
+};
+
+inline WildCard::WildCard() :
+ aWildString( '*' )
+{
+ cSepSymbol = '\0';
+}
+
+inline WildCard::WildCard( const String& rWildCard, const char cSeparator ) :
+ aWildString( rWildCard, osl_getThreadTextEncoding())
+{
+ cSepSymbol = cSeparator;
+}
+
+inline WildCard& WildCard::operator=( const String& rString )
+{
+ aWildString = ByteString(rString, osl_getThreadTextEncoding());
+ return *this;
+}
+
+inline WildCard& WildCard::operator=( const WildCard& rWildCard )
+{
+ aWildString = rWildCard.aWildString;
+ cSepSymbol = rWildCard.cSepSymbol;
+ return *this;
+}
+
+#endif
diff --git a/tools/inc/tools/zcodec.hxx b/tools/inc/tools/zcodec.hxx
new file mode 100644
index 000000000000..d71e6afe7dfe
--- /dev/null
+++ b/tools/inc/tools/zcodec.hxx
@@ -0,0 +1,141 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: zcodec.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: vg $ $Date: 2007-04-11 20:21:48 $
+ *
+ * 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 _ZCODEC_HXX
+#define _ZCODEC_HXX
+
+#ifndef INCLUDED_TOOLSDLLAPI_H
+#include "tools/toolsdllapi.h"
+#endif
+
+#ifndef _SOLAR_H
+#include <tools/solar.h>
+#endif
+
+// -----------
+// - Defines -
+// -----------
+
+#define DEFAULT_IN_BUFSIZE (0x00008000UL)
+#define DEFAULT_OUT_BUFSIZE (0x00008000UL)
+
+#define MAX_MEM_USAGE 8
+
+//
+// memory requirement using compress:
+// [ INBUFFER ] + [ OUTBUFFER ] + 128KB + 1 << (MEM_USAGE+9)
+//
+// memory requirement using decompress:
+// [ INBUFFER ] + [ OUTBUFFER ] + 32KB
+//
+
+#define ZCODEC_NO_COMPRESSION (0x00000000UL)
+#define ZCODEC_BEST_SPEED (0x00000001UL)
+#define ZCODEC_DEFAULT_COMPRESSION (0x00000006UL)
+#define ZCODEC_BEST_COMPRESSION (0x00000009UL)
+
+#define ZCODEC_DEFAULT_STRATEGY (0x00000000UL)
+#define ZCODEC_ZFILTERED (0x00000100UL)
+#define ZCODEC_ZHUFFMAN_ONLY (0x00000200UL)
+
+#define ZCODEC_UPDATE_CRC (0x00010000UL)
+#define ZCODEC_GZ_LIB (0x00020000UL)
+
+#define ZCODEC_PNG_DEFAULT ( ZCODEC_NO_COMPRESSION | ZCODEC_DEFAULT_STRATEGY | ZCODEC_UPDATE_CRC )
+#define ZCODEC_DEFAULT ( ZCODEC_DEFAULT_COMPRESSION | ZCODEC_DEFAULT_STRATEGY )
+
+// ----------
+// - ZCodec -
+// ----------
+
+class SvStream;
+
+class TOOLS_DLLPUBLIC ZCodec
+{
+private:
+
+ ULONG mbInit;
+ BOOL mbStatus;
+ BOOL mbFinish;
+ ULONG mnMemUsage;
+ SvStream* mpIStm;
+ BYTE* mpInBuf;
+ ULONG mnInBufSize;
+ ULONG mnInToRead;
+ SvStream* mpOStm;
+ BYTE* mpOutBuf;
+ ULONG mnOutBufSize;
+
+ ULONG mnCRC;
+ ULONG mnCompressMethod;
+ void* mpsC_Stream;
+
+ void ImplInitBuf( BOOL nIOFlag );
+ void ImplWriteBack( void );
+
+public:
+ ZCodec( ULONG nInBuf, ULONG nOutBuf, ULONG nMemUsage = MAX_MEM_USAGE );
+ ZCodec( void );
+ virtual ~ZCodec();
+