A Hopf, Skip and a Jump
profilemanager.h
1 
4 #ifndef _PROFILEMANAGER_H_
5 #define _PROFILEMANAGER_H_
6 
7 #include <string>
8 
9 #include "rapidxml/rapidxml.hpp"
10 #include "rapidxml/rapidxml_utils.hpp"
11 
17 public:
23  ProfileManager(std::string config
24  = std::string("~/.config/hopfskipjump.xml"));
34  static const char protocol[];
40  rapidxml::xml_node<>* exists(const std::string& name) const;
41 
50  void saveProfile(const std::string& name, const std::string& profile);
58  std::string getProfile(const std::string& name) const;
59 
60 protected:
67  void deep_copy_names_values(rapidxml::xml_node<>& in,
68  rapidxml::xml_node<>& out,
69  rapidxml::xml_document<>& mem);
70  std::string configPath;
71  rapidxml::file<>* configXML;
72  rapidxml::xml_document<> profiles;
74 };
75 
76 #endif
void deep_copy_names_values(rapidxml::xml_node<> &in, rapidxml::xml_node<> &out, rapidxml::xml_document<> &mem)
Recursively clone a node and its values.
std::string getProfile(const std::string &name) const
Get an XML representation of a profile which can be used by fromXML()
static const char protocol[]
Protocol version in use by this release.
rapidxml::xml_document profiles
XML doc of known configurations.
rapidxml::xml_node * exists(const std::string &name) const
Determine whether the name profile exists in the database.
void saveProfile(const std::string &name, const std::string &profile)
Save a serialised profile under a given name, possibly overwriting an existing profile.
ProfileManager(std::string config=std::string("~/.config/hopfskipjump.xml"))
Create a profile manager to save and restore properties of DetectorBanks.
profilemanager.h
rapidxml::file * configXML
Known configurations.
std::string configPath
Path of the configuration file.
bool profilesModified
Document tree has been modified.
~ProfileManager()
Destroy this profile manager, rewriting the configuration file if any new profiles have been added...