14 #ifndef WS_FILE_PROPERTIES_H__
15 #define WS_FILE_PROPERTIES_H__
19 #include <boost/filesystem.hpp>
20 #include <boost/thread/mutex.hpp>
55 std::string
get(
const std::string& section,
const std::string& id,
const std::string& def);
69 bool isAllowed(std::set<std::string> gids);
86 void setRoot(
const std::string& jsonInput);
93 void set(
const std::string& section,
const std::string& key,
const std::string& value);
99 void setGroups(std::set<std::string> grps);
std::string getPath()
Get path of the node which the configuration belongs to.
boost::filesystem::path m_nodePath
int createPropertiesDirectories()
Creates the directories for the properties.
std::set< std::string > getGroups()
Returns the groups that have access to the node If no groups are found in the file, an empty set is returned.
int save()
save the properties to the disk The path of the file is set in m_nodePath and is set when building th...
void setRoot(Json::Value root)
set the root of the Json tree
Json::Value getRoot()
Return the root of the Json tree.
Abstract Properties class.
WsNodeProperties(boost::filesystem::path nodePath, Type t)
Constructor.
void set(const std::string §ion, const std::string &key, const std::string &value)
Changes or sets the propety with key 'key' to value 'value' If the property already exist...
bool isAllowed(std::set< std::string > gids)
Compare the gids with the node groups. If the user has access, true is returned, otherwise false is r...
void setGroups(std::set< std::string > grps)
Sets the groups of the node to grps. All groups will be overriden. This method does not however...
Abstract class for properties.