/src/libreoffice/package/source/zippackage/ZipPackageFolderEnumeration.cxx
Line | Count | Source |
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 | | * This file incorporates work covered by the following license notice: |
10 | | * |
11 | | * Licensed to the Apache Software Foundation (ASF) under one or more |
12 | | * contributor license agreements. See the NOTICE file distributed |
13 | | * with this work for additional information regarding copyright |
14 | | * ownership. The ASF licenses this file to you under the Apache |
15 | | * License, Version 2.0 (the "License"); you may not use this file |
16 | | * except in compliance with the License. You may obtain a copy of |
17 | | * the License at http://www.apache.org/licenses/LICENSE-2.0 . |
18 | | */ |
19 | | |
20 | | #include "ZipPackageFolderEnumeration.hxx" |
21 | | #include <cppuhelper/supportsservice.hxx> |
22 | | #include <sal/log.hxx> |
23 | | |
24 | | using namespace com::sun::star; |
25 | | |
26 | | ZipPackageFolderEnumeration::ZipPackageFolderEnumeration(ContentHash& rInput) |
27 | 222k | : rContents(rInput) |
28 | 222k | , aIterator(rContents.begin()) |
29 | 222k | { |
30 | 222k | } |
31 | | |
32 | 222k | ZipPackageFolderEnumeration::~ZipPackageFolderEnumeration() {} |
33 | | |
34 | | sal_Bool SAL_CALL ZipPackageFolderEnumeration::hasMoreElements() |
35 | 484k | { |
36 | 484k | return (aIterator != rContents.end()); |
37 | 484k | } |
38 | | uno::Any SAL_CALL ZipPackageFolderEnumeration::nextElement() |
39 | 262k | { |
40 | 262k | uno::Any aAny; |
41 | 262k | if (aIterator == rContents.end()) |
42 | 0 | throw container::NoSuchElementException(); |
43 | 262k | aAny <<= uno::Reference(cppu::getXWeak((*aIterator).second.xPackageEntry.get())); |
44 | 262k | ++aIterator; |
45 | 262k | return aAny; |
46 | 262k | } |
47 | | |
48 | | OUString ZipPackageFolderEnumeration::getImplementationName() |
49 | 0 | { |
50 | 0 | return u"ZipPackageFolderEnumeration"_ustr; |
51 | 0 | } |
52 | | |
53 | | uno::Sequence<OUString> ZipPackageFolderEnumeration::getSupportedServiceNames() |
54 | 0 | { |
55 | 0 | uno::Sequence<OUString> aNames{ u"com.sun.star.packages.PackageFolderEnumeration"_ustr }; |
56 | 0 | return aNames; |
57 | 0 | } |
58 | | |
59 | | sal_Bool SAL_CALL ZipPackageFolderEnumeration::supportsService(OUString const& rServiceName) |
60 | 0 | { |
61 | 0 | return cppu::supportsService(this, rServiceName); |
62 | 0 | } |
63 | | |
64 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |