Files
libreoffice/configmgr/source/modifications.hxx
Stephan Bergmann 03d960ac11 Avoid using incomplete types with std containers
...which is explicitly supported by Boost.Container though, but we cannot use
boost::container::map here as Boost.Container is only available since Boost 1.48
and our base is 1.47 still.  However, there appears no need for Children to be
sorted, and std::unordered_map (and thus boost::unordered_map) requires that
pointers to elements are not invalidated by insertions, which we do require.

Change-Id: I70ad6f40318d2bafae53ebb67d84c1c89a7d68f6
2014-05-06 10:41:18 +02:00

60 lines
1.5 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 .
*/
#ifndef INCLUDED_CONFIGMGR_SOURCE_MODIFICATIONS_HXX
#define INCLUDED_CONFIGMGR_SOURCE_MODIFICATIONS_HXX
#include "sal/config.h"
#include "boost/unordered_map.hpp"
#include "boost/noncopyable.hpp"
#include "path.hxx"
namespace configmgr {
class Modifications: private boost::noncopyable {
public:
struct Node {
typedef boost::unordered_map<OUString, Node, OUStringHash> Children;
Children children;
};
Modifications();
~Modifications();
void add(Path const & path);
void remove(Path const & path);
Node const & getRoot() const;
private:
Node root_;
};
}
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */