diff options
author | Jörg Budischewski <jbu@openoffice.org> | 2001-03-15 10:10:54 +0000 |
---|---|---|
committer | Jörg Budischewski <jbu@openoffice.org> | 2001-03-15 10:10:54 +0000 |
commit | c8788f7b86923b11cc357a877b2abaa365e6697c (patch) | |
tree | 2941ba481a3048c180b1c68236b0e0072fc4db33 /io | |
parent | dd7b9cdc3b179c0b20a44921b1044a712186b30c (diff) |
vos removed in favor of osl inline wrapper
Diffstat (limited to 'io')
-rw-r--r-- | io/source/acceptor/acc_pipe.cxx | 23 | ||||
-rw-r--r-- | io/source/acceptor/acc_socket.cxx | 46 | ||||
-rw-r--r-- | io/source/acceptor/acceptor.hxx | 25 | ||||
-rw-r--r-- | io/source/acceptor/makefile.mk | 5 | ||||
-rw-r--r-- | io/source/connector/connector.cxx | 26 | ||||
-rw-r--r-- | io/source/connector/connector.hxx | 18 | ||||
-rw-r--r-- | io/source/connector/ctr_socket.cxx | 24 | ||||
-rw-r--r-- | io/source/connector/makefile.mk | 5 |
8 files changed, 66 insertions, 106 deletions
diff --git a/io/source/acceptor/acc_pipe.cxx b/io/source/acceptor/acc_pipe.cxx index bada719de..4b2fd1532 100644 --- a/io/source/acceptor/acc_pipe.cxx +++ b/io/source/acceptor/acc_pipe.cxx @@ -2,9 +2,9 @@ * * $RCSfile: acc_pipe.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: jbu $ $Date: 2000-11-28 08:23:24 $ + * last change: $Author: jbu $ $Date: 2001-03-15 11:10:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -63,8 +63,8 @@ #include <cppuhelper/implbase1.hxx> -using namespace ::vos; using namespace ::rtl; +using namespace ::osl; using namespace ::cppu; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; @@ -98,7 +98,7 @@ namespace io_acceptor virtual ::rtl::OUString SAL_CALL getDescription( ) throw(::com::sun::star::uno::RuntimeException); public: - ::vos::OStreamPipe m_pipe; + ::osl::StreamPipe m_pipe; oslInterlockedCount m_nStatus; OUString m_sDescription; }; @@ -184,19 +184,14 @@ namespace io_acceptor void PipeAcceptor::init() { -#ifdef ENABLEUNICODE - m_pipe.create( m_sPipeName.pData , ::vos::OPipe::TOption_Create ); -#else - OString o = OUStringToOString( m_sPipeName , RTL_TEXTENCODING_ASCII_US ); - m_pipe.create( o.pData->buffer , ::vos::OPipe::TOption_Create ); -#endif + m_pipe = Pipe( m_sPipeName.pData , osl_Pipe_CREATE ); } Reference< XConnection > PipeAcceptor::accept( ) { PipeConnection *pConn = new PipeConnection( m_sPipeName , m_sConnectionDescription ); - OPipe::TPipeError status = m_pipe.accept( pConn->m_pipe ); + oslPipeError status = m_pipe.accept( pConn->m_pipe ); if( m_bClosed ) { @@ -204,13 +199,15 @@ namespace io_acceptor delete pConn; return Reference < XConnection >(); } - else if( OPipe::E_None == status ) + else if( osl_Pipe_E_None == status ) { return Reference < XConnection > ( (XConnection * ) pConn ); } else { - throw ConnectionSetupException(); + OUString error = OUString::createFromAscii( "io.acceptor: Couldn't setup pipe " ); + error += m_sPipeName; + throw ConnectionSetupException( error, Reference< XInterface > ()); } } diff --git a/io/source/acceptor/acc_socket.cxx b/io/source/acceptor/acc_socket.cxx index 8007eb46a..c575fef4a 100644 --- a/io/source/acceptor/acc_socket.cxx +++ b/io/source/acceptor/acc_socket.cxx @@ -2,9 +2,9 @@ * * $RCSfile: acc_socket.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: jbu $ $Date: 2000-11-28 08:23:24 $ + * last change: $Author: jbu $ $Date: 2001-03-15 11:10:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -136,8 +136,8 @@ namespace io_acceptor { public: void completeConnectionString(); - ::vos::OStreamSocket m_socket; - ::vos::OInetSocketAddr m_addr; + ::osl::StreamSocket m_socket; + ::osl::SocketAddr m_addr; oslInterlockedCount m_nStatus; ::rtl::OUString m_sDescription; @@ -205,31 +205,21 @@ namespace io_acceptor { { // make it unique m_sDescription += OUString( RTL_CONSTASCII_USTRINGPARAM( ",uniqueValue=" ) ); - m_sDescription += OUString::valueOf( (sal_Int64) (::vos::OObject * ) &m_socket , 10 ); + m_sDescription += OUString::valueOf( (sal_Int64) &m_socket , 10 ); } void SocketConnection::completeConnectionString() { - OUString sHost; - sal_Int32 nPort; - - nPort = m_socket.getPeerPort(); - m_socket.getPeerHost( sHost ); - OUStringBuffer buf( 256 ); buf.appendAscii( ",peerPort=" ); - buf.append( (sal_Int32) nPort ); + buf.append( (sal_Int32) m_socket.getPeerPort() ); buf.appendAscii( ",peerHost=" ); - buf.append( sHost ); - + buf.append( m_socket.getPeerHost( ) ); - nPort = m_socket.getLocalPort(); - m_socket.getLocalHost( sHost ); - buf.appendAscii( ",localPort=" ); - buf.append( (sal_Int32) nPort ); + buf.append( (sal_Int32) m_socket.getLocalPort() ); buf.appendAscii( ",localHost=" ); - buf.append( sHost ); + buf.append( m_socket.getLocalHost() ); m_sDescription += buf.makeStringAndClear(); } @@ -252,11 +242,8 @@ namespace io_acceptor { if(i != nBytesToRead) { - OUString errMessage; - m_socket.getError(errMessage); - OUString message(RTL_CONSTASCII_USTRINGPARAM("acc_socket.cxx:SocketConnection::read: error - ")); - message += errMessage; + message += m_socket.getErrorAsString(); IOException ioException(message, Reference<XInterface>(static_cast<XConnection *>(this))); @@ -293,11 +280,8 @@ namespace io_acceptor { { if( m_socket.write( seq.getConstArray() , seq.getLength() ) != seq.getLength() ) { - OUString errMessage; - m_socket.getError(errMessage); - OUString message(RTL_CONSTASCII_USTRINGPARAM("acc_socket.cxx:SocketConnection::write: error - ")); - message += errMessage; + message += m_socket.getErrorAsString(); IOException ioException(message, Reference<XInterface>(static_cast<XConnection *>(this))); @@ -379,8 +363,8 @@ namespace io_acceptor { void SocketAcceptor::init() { m_addr.setPort( m_nPort ); - m_addr.setAddr( m_sSocketName.pData ); - m_socket.setReuseAddr(1); + m_addr.setHostname( m_sSocketName.pData ); + m_socket.setOption( osl_Socket_OptionReuseAddr, 1); if(! m_socket.bind(m_addr) ) { @@ -401,7 +385,7 @@ namespace io_acceptor { { SocketConnection *pConn = new SocketConnection( m_sSocketName , m_nPort, m_sConnectionDescription ); - if( m_socket.acceptConnection( pConn->m_socket, pConn->m_addr )!= osl_Socket_Ok ) + if( m_socket.acceptConnection( pConn->m_socket )!= osl_Socket_Ok ) { // stopAccepting was called delete pConn; @@ -414,7 +398,7 @@ namespace io_acceptor { } pConn->completeConnectionString(); - pConn->m_socket.setTcpNoDelay( 1 ); + pConn->m_socket.setOption( osl_Socket_OptionTcpNoDelay, 1 ); return Reference < XConnection > ( (XConnection * ) pConn ); } diff --git a/io/source/acceptor/acceptor.hxx b/io/source/acceptor/acceptor.hxx index 842633602..8d59c69c9 100644 --- a/io/source/acceptor/acceptor.hxx +++ b/io/source/acceptor/acceptor.hxx @@ -2,9 +2,9 @@ * * $RCSfile: acceptor.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: jbu $ $Date: 2000-11-28 08:23:24 $ + * last change: $Author: jbu $ $Date: 2001-03-15 11:10:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -59,8 +59,13 @@ * ************************************************************************/ -#include <vos/pipe.hxx> -#include <vos/socket.hxx> +#ifndef _OSL_PIPE_HXX_ +#include <osl/pipe.hxx> +#endif + +#ifndef _OSL_SOCKET_HXX_ +#include <osl/socket.hxx> +#endif #include <com/sun/star/connection/XConnection.hpp> @@ -72,12 +77,11 @@ namespace io_acceptor { PipeAcceptor( const ::rtl::OUString &sPipeName , const ::rtl::OUString &sConnectionDescription ); void init(); - ::com::sun::star::uno::Reference < ::com::sun::star::connection::XConnection > - accept( ); + ::com::sun::star::uno::Reference < ::com::sun::star::connection::XConnection > accept( ); void stopAccepting(); - ::vos::OPipe m_pipe; + ::osl::Pipe m_pipe; ::rtl::OUString m_sPipeName; ::rtl::OUString m_sConnectionDescription; sal_Bool m_bClosed; @@ -91,13 +95,12 @@ namespace io_acceptor { const ::rtl::OUString &sConnectionDescription ); void init(); - ::com::sun::star::uno::Reference < ::com::sun::star::connection::XConnection > - accept(); + ::com::sun::star::uno::Reference < ::com::sun::star::connection::XConnection > accept(); void stopAccepting(); - ::vos::OInetSocketAddr m_addr; - ::vos::OAcceptorSocket m_socket; + ::osl::SocketAddr m_addr; + ::osl::AcceptorSocket m_socket; ::rtl::OUString m_sSocketName; ::rtl::OUString m_sConnectionDescription; sal_uInt16 m_nPort; diff --git a/io/source/acceptor/makefile.mk b/io/source/acceptor/makefile.mk index 76ea9cc16..c61c3a2a8 100644 --- a/io/source/acceptor/makefile.mk +++ b/io/source/acceptor/makefile.mk @@ -2,9 +2,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.6 $ +# $Revision: 1.7 $ # -# last change: $Author: pluby $ $Date: 2001-03-02 07:15:36 $ +# last change: $Author: jbu $ $Date: 2001-03-15 11:10:54 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -90,7 +90,6 @@ SHL1TARGET= $(TARGET) SHL1STDLIBS= \ $(SALLIB) \ - $(VOSLIB) \ $(CPPULIB) \ $(CPPUHELPERLIB) diff --git a/io/source/connector/connector.cxx b/io/source/connector/connector.cxx index 094ffc59f..ee081987e 100644 --- a/io/source/connector/connector.cxx +++ b/io/source/connector/connector.cxx @@ -2,9 +2,9 @@ * * $RCSfile: connector.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: jl $ $Date: 2001-03-12 15:51:12 $ + * last change: $Author: jbu $ $Date: 2001-03-15 11:09:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -76,7 +76,6 @@ using namespace ::osl; using namespace ::rtl; using namespace ::cppu; -using namespace ::vos; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::registry; @@ -214,7 +213,8 @@ namespace stoc_connector PipeConnection *pConn = new PipeConnection(sName , sConnectionDescription ); - if( pConn->m_pipe.create( sName.pData, ::vos::OPipe::TOption_Open ) ) + ; + if( pConn->m_pipe.create( sName.pData, osl_Pipe_OPEN ) ) { r = Reference < XConnection > ( (XConnection * ) pConn ); } @@ -259,23 +259,13 @@ namespace stoc_connector SocketConnection *pConn = new SocketConnection( sHost , nPort , sConnectionDescription); - if( ! pConn->m_socket.bind( pConn->m_addr ) ) - { - OUString sMessage = OUString::createFromAscii( "Connector : couldn't bind socket (" ); - OUString sError; - pConn->m_socket.getError( sError ); - sMessage += sError; - sMessage += OUString::createFromAscii( ")" ); - delete pConn; - throw ConnectionSetupException( sMessage, Reference < XInterface >() ); - } - pConn->m_socket.setTcpNoDelay( 1 ); - OInetSocketAddr AddrTarget( sHost.pData, nPort ); + + pConn->m_socket.setOption( osl_Socket_OptionTcpNoDelay , sal_True ); + SocketAddr AddrTarget( sHost.pData, nPort ); if(pConn->m_socket.connect(AddrTarget) != osl_Socket_Ok) { OUString sMessage = OUString::createFromAscii( "Connector : couldn't connect to socket (" ); - OUString sError; - pConn->m_socket.getError( sError ); + OUString sError = pConn->m_socket.getErrorAsString(); sMessage += sError; sMessage += OUString::createFromAscii( ")" ); delete pConn; diff --git a/io/source/connector/connector.hxx b/io/source/connector/connector.hxx index 7c4097477..578092997 100644 --- a/io/source/connector/connector.hxx +++ b/io/source/connector/connector.hxx @@ -2,9 +2,9 @@ * * $RCSfile: connector.hxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: jbu $ $Date: 2000-11-28 08:20:57 $ + * last change: $Author: jbu $ $Date: 2001-03-15 11:09:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -67,11 +67,11 @@ #include <hash_set> -#ifndef _VOS_SOCKET_HXX_ -# include <vos/socket.hxx> +#ifndef _OSL_SOCKET_HXX_ +# include <osl/socket.hxx> #endif -#ifndef _VOS_PIPE_HXX_ -# include <vos/pipe.hxx> +#ifndef _OSL_PIPE_HXX_ +# include <osl/pipe.hxx> #endif namespace stoc_connector @@ -123,7 +123,7 @@ namespace stoc_connector virtual ::rtl::OUString SAL_CALL getDescription( ) throw(::com::sun::star::uno::RuntimeException); public: - ::vos::OStreamPipe m_pipe; + ::osl::StreamPipe m_pipe; oslInterlockedCount m_nStatus; ::rtl::OUString m_sDescription; }; @@ -161,8 +161,8 @@ namespace stoc_connector public: void completeConnectionString(); - ::vos::OConnectorSocket m_socket; - ::vos::OInetSocketAddr m_addr; + ::osl::ConnectorSocket m_socket; + ::osl::SocketAddr m_addr; oslInterlockedCount m_nStatus; ::rtl::OUString m_sDescription; diff --git a/io/source/connector/ctr_socket.cxx b/io/source/connector/ctr_socket.cxx index 23f3ae7ff..dcbbcb130 100644 --- a/io/source/connector/ctr_socket.cxx +++ b/io/source/connector/ctr_socket.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ctr_socket.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: jbu $ $Date: 2000-11-28 08:20:57 $ + * last change: $Author: jbu $ $Date: 2001-03-15 11:09:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -131,26 +131,20 @@ namespace stoc_connector { void SocketConnection::completeConnectionString() { - OUString sHost; sal_Int32 nPort; nPort = m_socket.getPeerPort(); - m_socket.getPeerHost( sHost ); OUStringBuffer buf( 256 ); buf.appendAscii( ",peerPort=" ); buf.append( (sal_Int32) nPort ); buf.appendAscii( ",peerHost=" ); - buf.append( sHost ); - - - nPort = m_socket.getLocalPort(); - m_socket.getLocalHost( sHost ); + buf.append( m_socket.getPeerHost() ); buf.appendAscii( ",localPort=" ); buf.append( (sal_Int32) nPort ); buf.appendAscii( ",localHost=" ); - buf.append( sHost ); + buf.append( m_socket.getLocalHost( ) ); m_sDescription += buf.makeStringAndClear(); } @@ -171,11 +165,8 @@ namespace stoc_connector { if(i != nBytesToRead) { - OUString errMessage; - m_socket.getError(errMessage); - OUString message(RTL_CONSTASCII_USTRINGPARAM("ctr_socket.cxx:SocketConnection::read: error - ")); - message += errMessage; + message += m_socket.getErrorAsString(); IOException ioException(message, Reference<XInterface>(static_cast<XConnection *>(this))); @@ -212,11 +203,8 @@ namespace stoc_connector { { if( m_socket.write( seq.getConstArray() , seq.getLength() ) != seq.getLength() ) { - OUString errMessage; - m_socket.getError(errMessage); - OUString message(RTL_CONSTASCII_USTRINGPARAM("ctr_socket.cxx:SocketConnection::write: error - ")); - message += errMessage; + message += m_socket.getErrorAsString(); IOException ioException(message, Reference<XInterface>(static_cast<XConnection *>(this))); diff --git a/io/source/connector/makefile.mk b/io/source/connector/makefile.mk index 19db2ec7e..8b036aa86 100644 --- a/io/source/connector/makefile.mk +++ b/io/source/connector/makefile.mk @@ -2,9 +2,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.7 $ +# $Revision: 1.8 $ # -# last change: $Author: pluby $ $Date: 2001-03-02 07:15:40 $ +# last change: $Author: jbu $ $Date: 2001-03-15 11:09:54 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -91,7 +91,6 @@ SHL1TARGET= $(TARGET) SHL1STDLIBS= \ $(SALLIB) \ $(CPPULIB) \ - $(VOSLIB) \ $(CPPUHELPERLIB) SHL1DEPN= |