#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 $
*
* $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
* either of the following licenses
@@ -105,7 +105,6 @@ private:
ByteGrabber aGrabber;
com::sun::star::uno::Reference < com::sun::star::io::XInputStream > xStream;
public:
//ZipFile( void );
ZipFile( com::sun::star::uno::Reference < com::sun::star::io::XInputStream > &xInput);
virtual ~ZipFile();

View File

@@ -2,9 +2,9 @@
*
* $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
* either of the following licenses
@@ -113,7 +113,7 @@ private:
CRC32 aCRC;
sal_Bool bFinished;
ByteChucker aChucker;
::std::vector <::com::sun::star::package::ZipEntry> aZipList;
::std::vector < ::com::sun::star::package::ZipEntry > aZipList;
public:
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 $
*
* $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
* either of the following licenses
@@ -75,11 +75,13 @@ CRC32::CRC32()
CRC32::~CRC32()
{
}
void CRC32::reset()
void SAL_CALL CRC32::reset()
throw(uno::RuntimeException)
{
nCRC=0;
}
sal_Int32 CRC32::getValue()
sal_Int32 SAL_CALL CRC32::getValue()
throw(uno::RuntimeException)
{
return nCRC & 0xFFFFFFFFL;
}

View File

@@ -2,9 +2,9 @@
*
* $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
* either of the following licenses
@@ -89,26 +89,6 @@ ZipFile::ZipFile (uno::Reference < io::XInputStream > &xInput)
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()
{
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;
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 );
return xEnumRef;
}
::rtl::OUString ZipFile::getName()
::rtl::OUString SAL_CALL ZipFile::getName( )
throw(uno::RuntimeException)
{
return sName;
}
sal_Int32 ZipFile::getSize()
sal_Int32 SAL_CALL ZipFile::getSize( )
throw(uno::RuntimeException)
{
return nTotal;
}
uno::Type ZipFile::getElementType()
uno::Type SAL_CALL ZipFile::getElementType( )
throw(uno::RuntimeException)
{
return ::getCppuType((package::ZipEntry *) 0);
}
sal_Bool ZipFile::hasElements()
sal_Bool SAL_CALL ZipFile::hasElements( )
throw(uno::RuntimeException)
{
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;
sal_Int32 nHash = abs(rName.hashCode() % nTableLen);
sal_Int32 nHash = abs(aName.hashCode() % nTableLen);
ZipEntryImpl * pEntry = pTable[nHash];
while (pEntry != NULL)
{
if (rName == pEntry->getName())
if (aName == pEntry->getName())
{
//uno::Reference < package::ZepEntry > xEntry = pEntry;
aAny <<= *(pEntry->pEntry);
@@ -176,26 +163,29 @@ uno::Any ZipFile::getByName(const ::rtl::OUString& rName)
throw container::NoSuchElementException();
return aAny;
}
uno::Sequence<rtl::OUString> ZipFile::getElementNames()
uno::Sequence< ::rtl::OUString > SAL_CALL ZipFile::getElementNames( )
throw(uno::RuntimeException)
{
OUString *pNames = new OUString[nTotal];
for (int i = 0; i < nTotal; i++)
pNames[i] = pEntries[i].sName;
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];
while (pEntry != NULL)
{
if (rName == pEntry->getName())
if (aName == pEntry->getName())
return sal_True;
pEntry = pEntry->pNext;
}
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;
if (rEntry.nOffset <= 0)

View File

@@ -2,9 +2,9 @@
*
* $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
* 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 )
throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
{
if (aPropertyName == L"MediaType")
if (aPropertyName == OUString::createFromAscii("MediaType"))
aValue >>= sMediaType;
else if (aPropertyName == L"Size")
else if (aPropertyName == OUString::createFromAscii("Size"))
aValue >>= aEntry.nSize;
else
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 )
throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
if (PropertyName == L"MediaType")
if (PropertyName == OUString::createFromAscii("MediaType"))
{
uno::Any aAny;
aAny <<= sMediaType;
return aAny;
}
else if (PropertyName == L"Size")
else if (PropertyName == OUString::createFromAscii("Size"))
{
uno::Any aAny;
aAny <<= aEntry.nSize;
@@ -268,7 +268,7 @@ void ZipPackageFolder::saveContents(rtl::OUString &rPath)
if (bIsFolder)
{
time_t nTime = 0;
pFolder->aEntry.sName = rPath + pFolder->getName() + L"/";
pFolder->aEntry.sName = rPath + pFolder->getName() + OUString::createFromAscii("/");
#ifdef _DEBUG_RECURSION_
/*pFolder->aEntry.nMethod = STORED;*/
ByteString sByte(String(pFolder->aEntry.sName),RTL_TEXTENCODING_ASCII_US);

View File

@@ -2,9 +2,9 @@
*
* $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
* 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 )
throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
{
if (aPropertyName == L"MediaType")
if (aPropertyName == ::rtl::OUString::createFromAscii("MediaType"))
aValue >>= aEntry.sComment;
else if (aPropertyName == L"Size")
else if (aPropertyName == ::rtl::OUString::createFromAscii("Size"))
aValue >>= aEntry.nSize;
else
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 )
throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
if (PropertyName == L"MediaType")
if (PropertyName == ::rtl::OUString::createFromAscii("MediaType"))
{
uno::Any aAny;
aAny <<= aEntry.sComment;
return aAny;
}
else if (PropertyName == L"Size")
else if (PropertyName == ::rtl::OUString::createFromAscii("Size"))
{
uno::Any aAny;
aAny <<= aEntry.nSize;

View File

@@ -2,9 +2,9 @@
#
# $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
# either of the following licenses
@@ -76,12 +76,12 @@ ENABLE_EXCEPTIONS=TRUE
# --- Files --------------------------------------------------------
SLOFILES= \
$(SLO)$/ZipPackage.obj \
$(SLO)$/ZipPackageBuffer.obj \
$(SLO)$/ZipPackageEntry.obj \
$(SLO)$/ZipPackageFolder.obj \
$(SLO)$/ZipPackage.obj \
$(SLO)$/ZipPackageBuffer.obj \
$(SLO)$/ZipPackageEntry.obj \
$(SLO)$/ZipPackageFolder.obj \
$(SLO)$/ZipPackageFolderEnumeration.obj \
$(SLO)$/ZipPackageSink.obj \
$(SLO)$/ZipPackageSink.obj \
$(SLO)$/ZipPackageStream.obj
# --- UNO stuff ---------------------------------------------------