ucbhelper::Std{In,Out}putStream are only used in ucb/source/ucb/cmis/

...where their use of boost::shared_ptr (instead of std::shared_ptr) matches the
use in libcmis, but makes them unlikely to be useful anywhere else.  So move
them into ucb/source/ucb/cmis/.

Change-Id: I68359be6b43d6889af4f241dcdcbdc0d9d70d717
This commit is contained in:
Stephan Bergmann
2016-08-22 14:52:28 +02:00
parent 12c152ccbf
commit 2d8911d939
7 changed files with 26 additions and 31 deletions

View File

@@ -43,6 +43,8 @@ $(eval $(call gb_Library_add_exception_objects,ucpcmis1,\
ucb/source/ucp/cmis/cmis_provider \ ucb/source/ucp/cmis/cmis_provider \
ucb/source/ucp/cmis/cmis_resultset \ ucb/source/ucp/cmis/cmis_resultset \
ucb/source/ucp/cmis/cmis_url \ ucb/source/ucp/cmis/cmis_url \
ucb/source/ucp/cmis/std_inputstream \
ucb/source/ucp/cmis/std_outputstream \
)) ))
# vim: set noet sw=4 ts=4: # vim: set noet sw=4 ts=4:

View File

@@ -46,8 +46,6 @@
#include <ucbhelper/cancelcommandexecution.hxx> #include <ucbhelper/cancelcommandexecution.hxx>
#include <ucbhelper/content.hxx> #include <ucbhelper/content.hxx>
#include <ucbhelper/contentidentifier.hxx> #include <ucbhelper/contentidentifier.hxx>
#include <ucbhelper/std_inputstream.hxx>
#include <ucbhelper/std_outputstream.hxx>
#include <ucbhelper/propertyvalueset.hxx> #include <ucbhelper/propertyvalueset.hxx>
#include <ucbhelper/proxydecider.hxx> #include <ucbhelper/proxydecider.hxx>
#include <sax/tools/converter.hxx> #include <sax/tools/converter.hxx>
@@ -58,6 +56,8 @@
#include "cmis_provider.hxx" #include "cmis_provider.hxx"
#include "cmis_resultset.hxx" #include "cmis_resultset.hxx"
#include "cmis_strings.hxx" #include "cmis_strings.hxx"
#include <std_inputstream.hxx>
#include <std_outputstream.hxx>
#define OUSTR_TO_STDSTR(s) string( OUStringToOString( s, RTL_TEXTENCODING_UTF8 ).getStr() ) #define OUSTR_TO_STDSTR(s) string( OUStringToOString( s, RTL_TEXTENCODING_UTF8 ).getStr() )
#define STD_TO_OUSTR( str ) OUString( str.c_str(), str.length( ), RTL_TEXTENCODING_UTF8 ) #define STD_TO_OUSTR( str ) OUString( str.c_str(), str.length( ), RTL_TEXTENCODING_UTF8 )
@@ -1066,7 +1066,7 @@ namespace cmis
} }
boost::shared_ptr< ostream > pOut( new ostringstream ( ios_base::binary | ios_base::in | ios_base::out ) ); boost::shared_ptr< ostream > pOut( new ostringstream ( ios_base::binary | ios_base::in | ios_base::out ) );
uno::Reference < io::XOutputStream > xOutput = new ucbhelper::StdOutputStream( pOut ); uno::Reference < io::XOutputStream > xOutput = new StdOutputStream( pOut );
copyData( xIn, xOutput ); copyData( xIn, xOutput );
map< string, libcmis::PropertyPtr > newProperties; map< string, libcmis::PropertyPtr > newProperties;
@@ -1341,7 +1341,7 @@ namespace cmis
if ( nullptr != document ) if ( nullptr != document )
{ {
boost::shared_ptr< ostream > pOut( new ostringstream ( ios_base::binary | ios_base::in | ios_base::out ) ); boost::shared_ptr< ostream > pOut( new ostringstream ( ios_base::binary | ios_base::in | ios_base::out ) );
uno::Reference < io::XOutputStream > xOutput = new ucbhelper::StdOutputStream( pOut ); uno::Reference < io::XOutputStream > xOutput = new StdOutputStream( pOut );
copyData( xInputStream, xOutput ); copyData( xInputStream, xOutput );
try try
{ {
@@ -1380,7 +1380,7 @@ namespace cmis
else else
{ {
boost::shared_ptr< ostream > pOut( new ostringstream ( ios_base::binary | ios_base::in | ios_base::out ) ); boost::shared_ptr< ostream > pOut( new ostringstream ( ios_base::binary | ios_base::in | ios_base::out ) );
uno::Reference < io::XOutputStream > xOutput = new ucbhelper::StdOutputStream( pOut ); uno::Reference < io::XOutputStream > xOutput = new StdOutputStream( pOut );
copyData( xInputStream, xOutput ); copyData( xInputStream, xOutput );
try try
{ {
@@ -1548,7 +1548,7 @@ namespace cmis
boost::shared_ptr< istream > aIn = document->getContentStream( ); boost::shared_ptr< istream > aIn = document->getContentStream( );
uno::Reference< io::XInputStream > xIn = new ucbhelper::StdInputStream( aIn ); uno::Reference< io::XInputStream > xIn = new StdInputStream( aIn );
if( !xIn.is( ) ) if( !xIn.is( ) )
return false; return false;

View File

@@ -11,12 +11,12 @@
#include <sal/log.hxx> #include <sal/log.hxx>
#include "ucbhelper/std_inputstream.hxx" #include <std_inputstream.hxx>
using namespace std; using namespace std;
using namespace com::sun::star; using namespace com::sun::star;
namespace ucbhelper namespace cmis
{ {
StdInputStream::StdInputStream( boost::shared_ptr< istream > const & pStream ) : StdInputStream::StdInputStream( boost::shared_ptr< istream > const & pStream ) :
m_pStream( pStream ), m_pStream( pStream ),
@@ -76,7 +76,7 @@ namespace ucbhelper
} }
catch ( const ios_base::failure& e ) catch ( const ios_base::failure& e )
{ {
SAL_INFO( "ucbhelper", "StdInputStream::readBytes() error: " << e.what() ); SAL_INFO( "ucb.ucp.cmis", "StdInputStream::readBytes() error: " << e.what() );
throw io::IOException( ); throw io::IOException( );
} }
@@ -103,7 +103,7 @@ namespace ucbhelper
} }
catch ( const ios_base::failure& e ) catch ( const ios_base::failure& e )
{ {
SAL_INFO( "ucbhelper", "StdInputStream::readBytes() error: " << e.what() ); SAL_INFO( "ucb.ucp.cmis", "StdInputStream::readBytes() error: " << e.what() );
throw io::IOException( ); throw io::IOException( );
} }
return nRead; return nRead;
@@ -124,7 +124,7 @@ namespace ucbhelper
} }
catch ( const ios_base::failure& e ) catch ( const ios_base::failure& e )
{ {
SAL_INFO( "ucbhelper", "StdInputStream::readBytes() error: " << e.what() ); SAL_INFO( "ucb.ucp.cmis", "StdInputStream::readBytes() error: " << e.what() );
throw io::IOException( ); throw io::IOException( );
} }
} }
@@ -161,7 +161,7 @@ namespace ucbhelper
} }
catch ( const ios_base::failure& e ) catch ( const ios_base::failure& e )
{ {
SAL_INFO( "ucbhelper", "StdInputStream::readBytes() error: " << e.what() ); SAL_INFO( "ucb.ucp.cmis", "StdInputStream::readBytes() error: " << e.what() );
throw io::IOException( ); throw io::IOException( );
} }
} }

View File

@@ -7,8 +7,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/ */
#ifndef INCLUDED_UCBHELPER_STD_INPUTSTREAM_HXX #ifndef INCLUDED_UCB_SOURCE_UCP_CMIS_STD_INPUTSTREAM_HXX
#define INCLUDED_UCBHELPER_STD_INPUTSTREAM_HXX #define INCLUDED_UCB_SOURCE_UCP_CMIS_STD_INPUTSTREAM_HXX
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include <istream> #include <istream>
@@ -20,14 +20,12 @@
#include <com/sun/star/io/XInputStream.hpp> #include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/io/XSeekable.hpp> #include <com/sun/star/io/XSeekable.hpp>
#include <ucbhelper/ucbhelperdllapi.h> namespace cmis
namespace ucbhelper
{ {
/** Implements a seekable InputStream /** Implements a seekable InputStream
* working on an std::istream * working on an std::istream
*/ */
class UCBHELPER_DLLPUBLIC StdInputStream class StdInputStream
: public cppu::OWeakObject, : public cppu::OWeakObject,
public css::io::XInputStream, public css::io::XInputStream,
public css::io::XSeekable public css::io::XSeekable

View File

@@ -11,12 +11,12 @@
#include <sal/log.hxx> #include <sal/log.hxx>
#include "ucbhelper/std_outputstream.hxx" #include <std_outputstream.hxx>
using namespace std; using namespace std;
using namespace com::sun::star; using namespace com::sun::star;
namespace ucbhelper namespace cmis
{ {
StdOutputStream::StdOutputStream( boost::shared_ptr< ostream > const & pStream ) : StdOutputStream::StdOutputStream( boost::shared_ptr< ostream > const & pStream ) :
m_pStream( pStream ) m_pStream( pStream )
@@ -61,7 +61,7 @@ namespace ucbhelper
} }
catch ( const ios_base::failure& e ) catch ( const ios_base::failure& e )
{ {
SAL_INFO( "ucbhelper", "Exception caught when calling write: " << e.what() ); SAL_INFO( "ucb.ucp.cmis", "Exception caught when calling write: " << e.what() );
throw io::IOException( ); throw io::IOException( );
} }
} }
@@ -81,7 +81,7 @@ namespace ucbhelper
} }
catch ( const ios_base::failure& e ) catch ( const ios_base::failure& e )
{ {
SAL_INFO( "ucbhelper", "Exception caught when calling flush: " << e.what() ); SAL_INFO( "ucb.ucp.cmis", "Exception caught when calling flush: " << e.what() );
throw io::IOException( ); throw io::IOException( );
} }
} }

View File

@@ -7,8 +7,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/ */
#ifndef INCLUDED_UCBHELPER_STD_OUTPUTSTREAM_HXX #ifndef INCLUDED_UCB_SOURCE_UCP_CMIS_STD_OUTPUTSTREAM_HXX
#define INCLUDED_UCBHELPER_STD_OUTPUTSTREAM_HXX #define INCLUDED_UCB_SOURCE_UCP_CMIS_STD_OUTPUTSTREAM_HXX
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include <ostream> #include <ostream>
@@ -17,14 +17,13 @@
#include <cppuhelper/weak.hxx> #include <cppuhelper/weak.hxx>
#include <cppuhelper/queryinterface.hxx> #include <cppuhelper/queryinterface.hxx>
#include <com/sun/star/io/XOutputStream.hpp> #include <com/sun/star/io/XOutputStream.hpp>
#include <ucbhelper/ucbhelperdllapi.h>
namespace ucbhelper namespace cmis
{ {
/** Implements a OutputStream /** Implements a OutputStream
* working on an std::ostream * working on an std::ostream
*/ */
class UCBHELPER_DLLPUBLIC StdOutputStream : class StdOutputStream :
public cppu::OWeakObject, public cppu::OWeakObject,
public css::io::XOutputStream public css::io::XOutputStream
{ {

View File

@@ -11,8 +11,6 @@ $(eval $(call gb_Library_Library,ucbhelper))
$(eval $(call gb_Library_use_sdk_api,ucbhelper)) $(eval $(call gb_Library_use_sdk_api,ucbhelper))
$(eval $(call gb_Library_use_external,ucbhelper,boost_headers))
$(eval $(call gb_Library_use_libraries,ucbhelper,\ $(eval $(call gb_Library_use_libraries,ucbhelper,\
cppu \ cppu \
cppuhelper \ cppuhelper \
@@ -51,8 +49,6 @@ $(eval $(call gb_Library_add_exception_objects,ucbhelper,\
ucbhelper/source/provider/simpleinteractionrequest \ ucbhelper/source/provider/simpleinteractionrequest \
ucbhelper/source/provider/simpleioerrorrequest \ ucbhelper/source/provider/simpleioerrorrequest \
ucbhelper/source/provider/simplenameclashresolverequest \ ucbhelper/source/provider/simplenameclashresolverequest \
ucbhelper/source/provider/std_inputstream \
ucbhelper/source/provider/std_outputstream \
)) ))
# vim: set noet sw=4 ts=4: # vim: set noet sw=4 ts=4: