#80556# now builds under Solaris correctly

This commit is contained in:
Martin Gallwey
2000-11-24 09:34:27 +00:00
parent 67b6cf9dfc
commit b28e187829
7 changed files with 57 additions and 66 deletions

View File

@@ -2,9 +2,9 @@
* *
* $RCSfile: ZipFile.hxx,v $ * $RCSfile: ZipFile.hxx,v $
* *
* $Revision: 1.2 $ * $Revision: 1.3 $
* *
* last change: $Author: mtg $ $Date: 2000-11-21 12:07:58 $ * last change: $Author: mtg $ $Date: 2000-11-24 10:34:26 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
@@ -105,7 +105,6 @@ private:
ByteGrabber aGrabber; ByteGrabber aGrabber;
com::sun::star::uno::Reference < com::sun::star::io::XInputStream > xStream; com::sun::star::uno::Reference < com::sun::star::io::XInputStream > xStream;
public: public:
//ZipFile( void );
ZipFile( com::sun::star::uno::Reference < com::sun::star::io::XInputStream > &xInput); ZipFile( com::sun::star::uno::Reference < com::sun::star::io::XInputStream > &xInput);
virtual ~ZipFile(); virtual ~ZipFile();

View File

@@ -2,9 +2,9 @@
* *
* $RCSfile: ZipOutputStream.hxx,v $ * $RCSfile: ZipOutputStream.hxx,v $
* *
* $Revision: 1.3 $ * $Revision: 1.4 $
* *
* last change: $Author: mtg $ $Date: 2000-11-21 12:07:58 $ * last change: $Author: mtg $ $Date: 2000-11-24 10:34:26 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
@@ -113,7 +113,7 @@ private:
CRC32 aCRC; CRC32 aCRC;
sal_Bool bFinished; sal_Bool bFinished;
ByteChucker aChucker; ByteChucker aChucker;
::std::vector <::com::sun::star::package::ZipEntry> aZipList; ::std::vector < ::com::sun::star::package::ZipEntry > aZipList;
public: public:
ZipOutputStream( com::sun::star::uno::Reference < com::sun::star::io::XOutputStream > &xOStream, sal_Int32 nNewBufferSize); ZipOutputStream( com::sun::star::uno::Reference < com::sun::star::io::XOutputStream > &xOStream, sal_Int32 nNewBufferSize);

View File

@@ -2,9 +2,9 @@
* *
* $RCSfile: CRC32.cxx,v $ * $RCSfile: CRC32.cxx,v $
* *
* $Revision: 1.2 $ * $Revision: 1.3 $
* *
* last change: $Author: mtg $ $Date: 2000-11-16 11:55:52 $ * last change: $Author: mtg $ $Date: 2000-11-24 10:34:26 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
@@ -75,11 +75,13 @@ CRC32::CRC32()
CRC32::~CRC32() CRC32::~CRC32()
{ {
} }
void CRC32::reset() void SAL_CALL CRC32::reset()
throw(uno::RuntimeException)
{ {
nCRC=0; nCRC=0;
} }
sal_Int32 CRC32::getValue() sal_Int32 SAL_CALL CRC32::getValue()
throw(uno::RuntimeException)
{ {
return nCRC & 0xFFFFFFFFL; return nCRC & 0xFFFFFFFFL;
} }

View File

@@ -2,9 +2,9 @@
* *
* $RCSfile: ZipFile.cxx,v $ * $RCSfile: ZipFile.cxx,v $
* *
* $Revision: 1.5 $ * $Revision: 1.6 $
* *
* last change: $Author: mtg $ $Date: 2000-11-23 14:15:51 $ * last change: $Author: mtg $ $Date: 2000-11-24 10:34:26 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
@@ -89,26 +89,6 @@ ZipFile::ZipFile (uno::Reference < io::XInputStream > &xInput)
readCEN(); readCEN();
} }
/*
ZipFile::ZipFile( void )
:pEntries(NULL)
, pTable(NULL)
, nTotal(0)
, nTableLen(0)
{
}
void SAL_CALL ZipFile::setInputStream( const uno::Reference< io::XInputStream >& xInput )
throw(io::IOException, package::ZipException, uno::RuntimeException)
{
xStream = uno::Reference <io::XInputStream> (xInput);
aGrabber.setInputStream ( xInput );
readCEN();
}
*/
//ZipFile::ZipFile (const uno::Reference < lang::XMultiServiceFactory > &xFactory)
//{
//}
ZipFile::~ZipFile() ZipFile::~ZipFile()
{ {
if (pEntries != NULL) if (pEntries != NULL)
@@ -128,11 +108,13 @@ ZipFile::~ZipFile()
} }
} }
void ZipFile::close() void SAL_CALL ZipFile::close( )
throw(io::IOException, uno::RuntimeException)
{ {
} }
uno::Reference<container::XEnumeration> ZipFile::entries() uno::Reference< container::XEnumeration > SAL_CALL ZipFile::entries( )
throw(uno::RuntimeException)
{ {
uno::Reference< container::XEnumeration> xEnumRef; uno::Reference< container::XEnumeration> xEnumRef;
xEnumRef= new ZipEnumeration( uno::Sequence < package::ZipEntry > (pEntries, nTotal) ); xEnumRef= new ZipEnumeration( uno::Sequence < package::ZipEntry > (pEntries, nTotal) );
@@ -140,32 +122,37 @@ uno::Reference<container::XEnumeration> ZipFile::entries()
// xEnumRef = uno::Reference < container::XEnumeration>( static_cast < container::XEnumeration *> (pEnum), uno::UNO_QUERY ); // xEnumRef = uno::Reference < container::XEnumeration>( static_cast < container::XEnumeration *> (pEnum), uno::UNO_QUERY );
return xEnumRef; return xEnumRef;
} }
::rtl::OUString ZipFile::getName() ::rtl::OUString SAL_CALL ZipFile::getName( )
throw(uno::RuntimeException)
{ {
return sName; return sName;
} }
sal_Int32 ZipFile::getSize() sal_Int32 SAL_CALL ZipFile::getSize( )
throw(uno::RuntimeException)
{ {
return nTotal; return nTotal;
} }
uno::Type ZipFile::getElementType() uno::Type SAL_CALL ZipFile::getElementType( )
throw(uno::RuntimeException)
{ {
return ::getCppuType((package::ZipEntry *) 0); return ::getCppuType((package::ZipEntry *) 0);
} }
sal_Bool ZipFile::hasElements() sal_Bool SAL_CALL ZipFile::hasElements( )
throw(uno::RuntimeException)
{ {
return (nTotal>0); return (nTotal>0);
} }
uno::Any ZipFile::getByName(const ::rtl::OUString& rName) uno::Any SAL_CALL ZipFile::getByName( const ::rtl::OUString& aName )
throw(container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
{ {
uno::Any aAny; uno::Any aAny;
sal_Int32 nHash = abs(rName.hashCode() % nTableLen); sal_Int32 nHash = abs(aName.hashCode() % nTableLen);
ZipEntryImpl * pEntry = pTable[nHash]; ZipEntryImpl * pEntry = pTable[nHash];
while (pEntry != NULL) while (pEntry != NULL)
{ {
if (rName == pEntry->getName()) if (aName == pEntry->getName())
{ {
//uno::Reference < package::ZepEntry > xEntry = pEntry; //uno::Reference < package::ZepEntry > xEntry = pEntry;
aAny <<= *(pEntry->pEntry); aAny <<= *(pEntry->pEntry);
@@ -176,26 +163,29 @@ uno::Any ZipFile::getByName(const ::rtl::OUString& rName)
throw container::NoSuchElementException(); throw container::NoSuchElementException();
return aAny; return aAny;
} }
uno::Sequence<rtl::OUString> ZipFile::getElementNames() uno::Sequence< ::rtl::OUString > SAL_CALL ZipFile::getElementNames( )
throw(uno::RuntimeException)
{ {
OUString *pNames = new OUString[nTotal]; OUString *pNames = new OUString[nTotal];
for (int i = 0; i < nTotal; i++) for (int i = 0; i < nTotal; i++)
pNames[i] = pEntries[i].sName; pNames[i] = pEntries[i].sName;
return uno::Sequence<OUString> (pNames, nTotal); return uno::Sequence<OUString> (pNames, nTotal);
} }
sal_Bool ZipFile::hasByName(const ::rtl::OUString& rName) sal_Bool SAL_CALL ZipFile::hasByName( const ::rtl::OUString& aName )
throw(uno::RuntimeException)
{ {
sal_Int32 nHash = abs(rName.hashCode() % nTableLen); sal_Int32 nHash = abs(aName.hashCode() % nTableLen);
ZipEntryImpl * pEntry = pTable[nHash]; ZipEntryImpl * pEntry = pTable[nHash];
while (pEntry != NULL) while (pEntry != NULL)
{ {
if (rName == pEntry->getName()) if (aName == pEntry->getName())
return sal_True; return sal_True;
pEntry = pEntry->pNext; pEntry = pEntry->pNext;
} }
return sal_False; return sal_False;
} }
uno::Reference< io::XInputStream> ZipFile::getInputStream(const package::ZipEntry& rEntry) uno::Reference< io::XInputStream > SAL_CALL ZipFile::getInputStream( const package::ZipEntry& rEntry )
throw(io::IOException, package::ZipException, uno::RuntimeException)
{ {
sal_Int64 nEnd = rEntry.nCompressedSize == 0 ? rEntry.nSize : rEntry.nCompressedSize; sal_Int64 nEnd = rEntry.nCompressedSize == 0 ? rEntry.nSize : rEntry.nCompressedSize;
if (rEntry.nOffset <= 0) if (rEntry.nOffset <= 0)

View File

@@ -2,9 +2,9 @@
* *
* $RCSfile: ZipPackageFolder.cxx,v $ * $RCSfile: ZipPackageFolder.cxx,v $
* *
* $Revision: 1.6 $ * $Revision: 1.7 $
* *
* last change: $Author: mtg $ $Date: 2000-11-23 14:15:52 $ * last change: $Author: mtg $ $Date: 2000-11-24 10:34:27 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
@@ -195,9 +195,9 @@ uno::Reference< beans::XPropertySetInfo > SAL_CALL ZipPackageFolder::getProperty
void SAL_CALL ZipPackageFolder::setPropertyValue( const ::rtl::OUString& aPropertyName, const uno::Any& aValue ) void SAL_CALL ZipPackageFolder::setPropertyValue( const ::rtl::OUString& aPropertyName, const uno::Any& aValue )
throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException) throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
{ {
if (aPropertyName == L"MediaType") if (aPropertyName == OUString::createFromAscii("MediaType"))
aValue >>= sMediaType; aValue >>= sMediaType;
else if (aPropertyName == L"Size") else if (aPropertyName == OUString::createFromAscii("Size"))
aValue >>= aEntry.nSize; aValue >>= aEntry.nSize;
else else
throw beans::UnknownPropertyException(); throw beans::UnknownPropertyException();
@@ -205,13 +205,13 @@ void SAL_CALL ZipPackageFolder::setPropertyValue( const ::rtl::OUString& aProper
uno::Any SAL_CALL ZipPackageFolder::getPropertyValue( const ::rtl::OUString& PropertyName ) uno::Any SAL_CALL ZipPackageFolder::getPropertyValue( const ::rtl::OUString& PropertyName )
throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{ {
if (PropertyName == L"MediaType") if (PropertyName == OUString::createFromAscii("MediaType"))
{ {
uno::Any aAny; uno::Any aAny;
aAny <<= sMediaType; aAny <<= sMediaType;
return aAny; return aAny;
} }
else if (PropertyName == L"Size") else if (PropertyName == OUString::createFromAscii("Size"))
{ {
uno::Any aAny; uno::Any aAny;
aAny <<= aEntry.nSize; aAny <<= aEntry.nSize;
@@ -268,7 +268,7 @@ void ZipPackageFolder::saveContents(rtl::OUString &rPath)
if (bIsFolder) if (bIsFolder)
{ {
time_t nTime = 0; time_t nTime = 0;
pFolder->aEntry.sName = rPath + pFolder->getName() + L"/"; pFolder->aEntry.sName = rPath + pFolder->getName() + OUString::createFromAscii("/");
#ifdef _DEBUG_RECURSION_ #ifdef _DEBUG_RECURSION_
/*pFolder->aEntry.nMethod = STORED;*/ /*pFolder->aEntry.nMethod = STORED;*/
ByteString sByte(String(pFolder->aEntry.sName),RTL_TEXTENCODING_ASCII_US); ByteString sByte(String(pFolder->aEntry.sName),RTL_TEXTENCODING_ASCII_US);

View File

@@ -2,9 +2,9 @@
* *
* $RCSfile: ZipPackageStream.cxx,v $ * $RCSfile: ZipPackageStream.cxx,v $
* *
* $Revision: 1.5 $ * $Revision: 1.6 $
* *
* last change: $Author: mtg $ $Date: 2000-11-23 14:15:52 $ * last change: $Author: mtg $ $Date: 2000-11-24 10:34:27 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
@@ -155,9 +155,9 @@ uno::Reference< beans::XPropertySetInfo > SAL_CALL ZipPackageStream::getProperty
void SAL_CALL ZipPackageStream::setPropertyValue( const ::rtl::OUString& aPropertyName, const uno::Any& aValue ) void SAL_CALL ZipPackageStream::setPropertyValue( const ::rtl::OUString& aPropertyName, const uno::Any& aValue )
throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException) throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
{ {
if (aPropertyName == L"MediaType") if (aPropertyName == ::rtl::OUString::createFromAscii("MediaType"))
aValue >>= aEntry.sComment; aValue >>= aEntry.sComment;
else if (aPropertyName == L"Size") else if (aPropertyName == ::rtl::OUString::createFromAscii("Size"))
aValue >>= aEntry.nSize; aValue >>= aEntry.nSize;
else else
throw beans::UnknownPropertyException(); throw beans::UnknownPropertyException();
@@ -165,13 +165,13 @@ void SAL_CALL ZipPackageStream::setPropertyValue( const ::rtl::OUString& aProper
uno::Any SAL_CALL ZipPackageStream::getPropertyValue( const ::rtl::OUString& PropertyName ) uno::Any SAL_CALL ZipPackageStream::getPropertyValue( const ::rtl::OUString& PropertyName )
throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{ {
if (PropertyName == L"MediaType") if (PropertyName == ::rtl::OUString::createFromAscii("MediaType"))
{ {
uno::Any aAny; uno::Any aAny;
aAny <<= aEntry.sComment; aAny <<= aEntry.sComment;
return aAny; return aAny;
} }
else if (PropertyName == L"Size") else if (PropertyName == ::rtl::OUString::createFromAscii("Size"))
{ {
uno::Any aAny; uno::Any aAny;
aAny <<= aEntry.nSize; aAny <<= aEntry.nSize;

View File

@@ -2,9 +2,9 @@
# #
# $RCSfile: makefile.mk,v $ # $RCSfile: makefile.mk,v $
# #
# $Revision: 1.5 $ # $Revision: 1.6 $
# #
# last change: $Author: mtg $ $Date: 2000-11-21 12:08:47 $ # last change: $Author: mtg $ $Date: 2000-11-24 10:34:27 $
# #
# The Contents of this file are made available subject to the terms of # The Contents of this file are made available subject to the terms of
# either of the following licenses # either of the following licenses
@@ -76,12 +76,12 @@ ENABLE_EXCEPTIONS=TRUE
# --- Files -------------------------------------------------------- # --- Files --------------------------------------------------------
SLOFILES= \ SLOFILES= \
$(SLO)$/ZipPackage.obj \ $(SLO)$/ZipPackage.obj \
$(SLO)$/ZipPackageBuffer.obj \ $(SLO)$/ZipPackageBuffer.obj \
$(SLO)$/ZipPackageEntry.obj \ $(SLO)$/ZipPackageEntry.obj \
$(SLO)$/ZipPackageFolder.obj \ $(SLO)$/ZipPackageFolder.obj \
$(SLO)$/ZipPackageFolderEnumeration.obj \ $(SLO)$/ZipPackageFolderEnumeration.obj \
$(SLO)$/ZipPackageSink.obj \ $(SLO)$/ZipPackageSink.obj \
$(SLO)$/ZipPackageStream.obj $(SLO)$/ZipPackageStream.obj
# --- UNO stuff --------------------------------------------------- # --- UNO stuff ---------------------------------------------------