LibreOffice Module configmgr (master) 1
data.hxx
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 * 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#pragma once
21
22#include <sal/config.h>
23
24#include <climits>
25#include "config_map.hxx"
26#include <vector>
27
28#include <rtl/ref.hxx>
29#include <rtl/ustring.hxx>
30#include <sal/types.h>
32
33#include "additions.hxx"
34#include "modifications.hxx"
35#include "nodemap.hxx"
36
37namespace configmgr {
38
39class Node;
40
41struct Data {
42 enum { NO_LAYER = INT_MAX };
43
45 int layer;
47 };
48
50
52
53 static OUString createSegment(
54 std::u16string_view templateName, OUString const & name);
55
56 static sal_Int32 parseSegment(
57 OUString const & path, sal_Int32 index, OUString * name,
58 bool * setElement, OUString * templateName);
59
60 static OUString fullTemplateName(
61 std::u16string_view component, std::u16string_view name);
62
63 //TODO: better rules under which circumstances a short template name matches
64 static bool equalTemplateNames(
65 OUString const & shortName, OUString const & longName);
66
67 Data();
68
70 OUString const & pathRepresentation,
71 OUString * canonicRepresentation, std::vector<OUString> * path, int * finalizedLayer)
72 const;
73
75 int layer, OUString const & fullName) const;
76
77 NodeMap & getComponents() const;
78
80 OUString const & url, int layer);
81
83 OUString const & url);
84
85private:
86 Data(const Data&) = delete;
87 Data& operator=(const Data&) = delete;
88
91
93
95};
96
97}
98
99/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
OUString name
Definition: components.cxx:85
std::vector< std::vector< OUString > > Additions
Definition: additions.hxx:31
rtl::Reference< ExtensionXcu > removeExtensionXcuAdditions(OUString const &url)
Definition: data.cxx:313
NodeMap templates
Definition: data.hxx:49
Data(const Data &)=delete
static OUString fullTemplateName(std::u16string_view component, std::u16string_view name)
Definition: data.cxx:152
config_map< rtl::Reference< ExtensionXcu > > ExtensionXcuAdditions
Definition: data.hxx:90
ExtensionXcuAdditions extensionXcuAdditions_
Definition: data.hxx:94
rtl::Reference< Node > root_
Definition: data.hxx:92
static sal_Int32 parseSegment(OUString const &path, sal_Int32 index, OUString *name, bool *setElement, OUString *templateName)
Definition: data.cxx:112
Modifications modifications
Definition: data.hxx:51
rtl::Reference< Node > resolvePathRepresentation(OUString const &pathRepresentation, OUString *canonicRepresentation, std::vector< OUString > *path, int *finalizedLayer) const
Definition: data.cxx:181
NodeMap & getComponents() const
Definition: data.cxx:293
static bool equalTemplateNames(OUString const &shortName, OUString const &longName)
Definition: data.cxx:163
Additions * addExtensionXcuAdditions(OUString const &url, int layer)
Definition: data.cxx:297
rtl::Reference< Node > getTemplate(int layer, OUString const &fullName) const
Definition: data.cxx:287
static OUString createSegment(std::u16string_view templateName, OUString const &name)
Definition: data.cxx:81
Data & operator=(const Data &)=delete