office-gobmx/configmgr/source/partial.hxx
Stephan Bergmann c28c61e528 Revert "boost::unordered_map to std::unordered_map in configmgr::Partial"
This reverts commit 154b204010, which is known
broken, as (unlike for boost::unordered_map) there is no guarantee that
std::unordered_map works for incomplete value types, and indeed there is build
environments that started to fail now with

> In file included from /home/libo/src/core/configmgr/source/partial.cxx:23:
> In file included from /usr/lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/set:60:
> In file included from /usr/lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/stl_tree.h:63:
> In file included from /usr/lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/stl_algobase.h:64:
> /usr/lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/stl_pair.h:218:11: error: field has incomplete type 'configmgr::Partial::Node'
>       _T2 second;                ///< The second member
>           ^
[...]

Change-Id: Ie8d041bcf3d3b1b6aeede73adbaf14676250c4bf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170467
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-07-14 17:32:17 +02:00

62 lines
1.8 KiB
C++

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#pragma once
#include <sal/config.h>
#include <set>
#include <boost/unordered_map.hpp>
#include <rtl/ustring.hxx>
namespace configmgr {
class Partial {
public:
enum Containment { CONTAINS_NOT, CONTAINS_SUBNODES, CONTAINS_NODE };
Partial(
css::uno::Sequence< OUString > const & includedPaths,
css::uno::Sequence< OUString > const & excludedPaths);
~Partial();
Containment contains(std::vector<OUString> const & path) const;
private:
Partial(const Partial&) = delete;
Partial& operator=(const Partial&) = delete;
struct Node {
typedef boost::unordered_map< OUString, Node, OUStringHash > Children;
Node(): startInclude(false) {}
void clear() { startInclude=false; children.clear(); }
Children children;
bool startInclude;
};
Node root_;
};
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */