2 * Copyright (C) 2015 Samsung Electronics Co., Ltd All Rights Reserved
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License version 2.1 as published by the Free Software Foundation.
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 * @author Maciej Karpiuk (m.karpiuk2@samsung.com)
21 * @brief Provisioning configuration
24 #ifndef LXCPP_PROVISION_CONFIG_HPP
25 #define LXCPP_PROVISION_CONFIG_HPP
27 #include "config/config.hpp"
28 #include "config/fields.hpp"
29 #include "config/fields-union.hpp"
38 typedef std::string ProvisionID;
41 * Provision configuration items
52 ProvisionID getId() const
56 std::to_string(static_cast<int>(type)) + " " +
57 std::to_string(flags) + " " +
74 bool operator==(const File& m) const
76 return ((m.type == type) && (m.path == path) &&
77 (m.flags == flags) && (m.mode == mode));
83 ProvisionID getId() const
89 std::to_string(flags) + " " +
108 bool operator==(const Mount& m) const
110 return ((m.source == source) && (m.target == target) && (m.type == type) &&
111 (m.flags == flags) && (m.data == data));
117 ProvisionID getId() const
119 return "link " + source + " " + target;
131 bool operator==(const Link& m) const
133 return ((m.source == source) && (m.target == target));
136 } // namespace provision
138 typedef std::vector<provision::File> FileVector;
139 typedef std::vector<provision::Mount> MountVector;
140 typedef std::vector<provision::Link> LinkVector;
142 struct ProvisionConfig
148 void addFile(const provision::File& newFile);
149 const FileVector& getFiles() const;
150 void removeFile(const provision::File& item);
152 void addMount(const provision::Mount& newMount);
153 const MountVector& getMounts() const;
154 void removeMount(const provision::Mount& item);
156 void addLink(const provision::Link& newLink);
157 const LinkVector& getLinks() const;
158 void removeLink(const provision::Link& item);
170 #endif // LXCPP_PROVISION_CONFIG_HPP