StormByte C++ Library: Config module 1.0.1.9999
StormByte-Config is the configuration module of the StormByte C++ suite.
Loading...
Searching...
No Matches
group.hxx
1/*
2 * Copyright (C) 2024-2026 David C. Manuelda (StormBytePP)
3 *
4 * This file is part of StormByte-Config.
5 *
6 * StormByte-Config is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License version 3
8 * or later, as published by the Free Software Foundation.
9 *
10 * StormByte-Config is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with StormByte-Config. If not, see
17 * <https://www.gnu.org/licenses/lgpl-3.0.html>.
18 */
19
20#pragma once
21
22#include <StormByte/config/item/container.hxx>
23
38 class STORMBYTE_CONFIG_PUBLIC Group: public Container {
39 public:
47 Group() = default;
48
53 Group(const std::string& name);
54
59 Group(std::string&& name);
60
65 Group(const Group& group) = default;
66
71 Group(Group&& group) noexcept = default;
72
78 Group& operator=(const Group& group) = default;
79
85 Group& operator=(Group&& group) noexcept = default;
86
90 ~Group() noexcept override = default;
101 inline PointerType Clone() const override {
102 return MakePointer<Group>(*this);
103 }
104
109 inline PointerType Move() override {
110 return MakePointer<Group>(std::move(*this));
111 }
112
117 constexpr Item::ContainerType ContainerType() const noexcept override {
118 return ContainerType::Group;
119 }
122 private:
130 Base::PointerType BeforeAdditionActions(Base::PointerType item, const StormByte::Config::OnExistingAction onexisting) override;
131 };
132}
Holds child items. Group and List derive from this.
Definition container.hxx:38
Named container { … } that can hold items, subgroups and lists.
Definition group.hxx:38
PointerType Move() override
Moves the group.
Definition group.hxx:109
Group(std::string &&name)
Constructs a Group with the given name (move).
Group()=default
Constructs an empty Group.
Group(const Group &group)=default
Copy constructor.
Group(const std::string &name)
Constructs a Group with the given name.
Group & operator=(const Group &group)=default
Copy assignment operator.
Group & operator=(Group &&group) noexcept=default
Move assignment operator.
Group(Group &&group) noexcept=default
Move constructor.
~Group() noexcept override=default
Destructor.
constexpr Item::ContainerType ContainerType() const noexcept override
Gets the container type.
Definition group.hxx:117
Configuration items (values, comments, groups, lists).
Definition alias.hxx:30
OnExistingAction
Forward declaration of the configuration document.
Definition typedefs.hxx:35