Implement XServiceInfo for com.sun.star.comp.MemoryStream

Change-Id: Ie5499d2ac4aac67dc73fdc58958443b8060c4139
This commit is contained in:
Matúš Kukan 2016-07-07 14:40:32 +02:00
parent 5f37f56088
commit e0192c0908

View File

@ -19,15 +19,13 @@
#include <algorithm>
#include "comphelper_module.hxx"
#include "comphelper_services.hxx"
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/io/XStream.hpp>
#include <com/sun/star/io/XSeekableInputStream.hpp>
#include <com/sun/star/io/XTruncate.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <osl/diagnose.h>
#include <string.h>
@ -43,12 +41,17 @@ using namespace ::osl;
namespace comphelper
{
class UNOMemoryStream : public WeakImplHelper< XStream, XSeekableInputStream, XOutputStream, XTruncate >
class UNOMemoryStream : public WeakImplHelper<XServiceInfo, XStream, XSeekableInputStream, XOutputStream, XTruncate>
{
public:
UNOMemoryStream();
virtual ~UNOMemoryStream();
// XServiceInfo
virtual OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException, std::exception) override;
virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) throw (css::uno::RuntimeException, std::exception) override;
virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) override;
// XStream
virtual Reference< XInputStream > SAL_CALL getInputStream( ) throw (RuntimeException, std::exception) override;
virtual Reference< XOutputStream > SAL_CALL getOutputStream( ) throw (RuntimeException, std::exception) override;
@ -87,6 +90,22 @@ UNOMemoryStream::~UNOMemoryStream()
{
}
// XServiceInfo
OUString SAL_CALL UNOMemoryStream::getImplementationName() throw (css::uno::RuntimeException, std::exception)
{
return OUString("com.sun.star.comp.MemoryStream");
}
sal_Bool SAL_CALL UNOMemoryStream::supportsService(const OUString& ServiceName) throw (css::uno::RuntimeException, std::exception)
{
return cppu::supportsService(this, ServiceName);
}
css::uno::Sequence<OUString> SAL_CALL UNOMemoryStream::getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception)
{
return { "com.sun.star.comp.MemoryStream" };
}
// XStream
Reference< XInputStream > SAL_CALL UNOMemoryStream::getInputStream( ) throw (RuntimeException, std::exception)
{