LibreOffice Module vcl (master)  1
UnoBinaryDataContainer.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  */
10 
12 
14 
15 using namespace css;
16 
17 // css::lang::XUnoTunnel
19 
20 css::uno::Sequence<sal_Int8> SAL_CALL UnoBinaryDataContainer::getCopyAsByteSequence()
21 {
22  if (maBinaryDataContainer.isEmpty())
23  return css::uno::Sequence<sal_Int8>();
24 
25  size_t nSize = maBinaryDataContainer.getSize();
26 
27  css::uno::Sequence<sal_Int8> aData(nSize);
28 
29  std::copy(maBinaryDataContainer.cbegin(), maBinaryDataContainer.cend(), aData.getArray());
30 
31  return aData;
32 }
33 
34 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
constexpr OUStringLiteral aData
UNO3_GETIMPLEMENTATION_IMPL(UnoBinaryDataContainer)
css::uno::Sequence< sal_Int8 > SAL_CALL getCopyAsByteSequence() override