25#include <com/sun/star/uno/RuntimeException.hpp>
26#include <rtl/ustring.hxx>
37 OUString
const & path, sal_Int32 * index, OUString * segment)
40 index !=
nullptr && *index >= 0 && *index <= path.getLength() &&
42 if (path[(*index)++] ==
'/') {
45 OUString templateName;
47 path, *index, &
name, &setElement, &templateName);
50 return *
index == path.getLength();
53 throw css::uno::RuntimeException(
"bad path " + path);
59 std::set< OUString >
const & includedPaths,
60 std::set< OUString >
const & excludedPaths)
73 bool end = parseSegment(includedPath, &
n, &seg);
74 p = &
p->children[seg];
75 if (
p->startInclude) {
80 p->startInclude =
true;
90 bool end = parseSegment(excludedPath, &
n, &seg);
92 p->children[seg].clear();
95 Node::Children::iterator j(
p->children.find(seg));
96 if (j ==
p->children.end()) {
117 bool bIncludes =
false;
118 for (
auto const& elemPath : path)
120 Node::Children::const_iterator j(
p->children.find(elemPath));
121 if (j ==
p->children.end()) {
125 bIncludes |=
p->startInclude;
127 return p->children.empty() && !
p->startInclude
Partial(std::set< OUString > const &includedPaths, std::set< OUString > const &excludedPaths)
Containment contains(std::vector< OUString > const &path) const
std::set< OUString > includedPaths
std::set< OUString > excludedPaths
static sal_Int32 parseSegment(OUString const &path, sal_Int32 index, OUString *name, bool *setElement, OUString *templateName)
static OUString createSegment(std::u16string_view templateName, OUString const &name)