diff options
author | Matúš Kukan <matus.kukan@gmail.com> | 2016-07-07 14:40:32 +0200 |
---|---|---|
committer | Matúš Kukan <matus.kukan@gmail.com> | 2016-07-09 12:15:51 +0200 |
commit | e0192c0908412c4e1c47cea12ea1adef9b9b3973 (patch) | |
tree | 75e669908f760cd929fdd4843c73f8dfb21538e9 /comphelper | |
parent | 5f37f56088eae48508336d68100b68cca407668a (diff) |
Implement XServiceInfo for com.sun.star.comp.MemoryStream
Change-Id: Ie5499d2ac4aac67dc73fdc58958443b8060c4139
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/source/streaming/memorystream.cxx | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/comphelper/source/streaming/memorystream.cxx b/comphelper/source/streaming/memorystream.cxx index 7b378964f81f..4e7601211224 100644 --- a/comphelper/source/streaming/memorystream.cxx +++ b/comphelper/source/streaming/memorystream.cxx @@ -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) { |