33 SCPM(
int options=0, std::ostream &info_out=cout, std::ostream &hash_out=cout, std::string root=
"" );
36 bool Enable(
bool force=
false );
39 bool Active( std::string &profile );
40 bool List( std::vector<std::string> &profiles );
42 bool Add( std::string profile,
bool auto_switch=
true );
43 bool Copy( std::string source_profile, std::string profile );
44 bool Create( std::string profile, std::string source_profile );
45 bool Delete( std::string profile );
46 bool Rename( std::string profile, std::string newprofile );
51 bool Modify( std::string profile, std::string action );
52 bool Set( std::string command, std::string argument, std::string profile=
"" );
53 bool Get( std::string command, std::string &result, std::string profile=
"" );
56 bool ShowChanges( std::ostream &output, std::string resource_type,
57 std::string resource_name,
bool backup=
false,
string version=
"" );
61 bool ListResourceSets( std::vector<std::string> &predefined, std::vector<std::string> &individual );
66 bool GetResourceGroup(
const std::string &name, std::vector<resource_entry_t> &group,
68 bool GetResourceGroup(
const std::string &name, std::vector<resource_entry_t> &group,
69 std::string &description,
bool nouser=
false );
70 bool SetResourceGroup(
const std::string &name,
const std::vector<resource_entry_t> &group,
71 const std::string &description );
83 bool SetConfigOption(
const std::string &option,
const std::string &value );
87 bool Update(
const std::string &scriptname, std::vector<pair<std::string, std::string> > resources );
88 bool UpdateResources( );
89 bool RestoreBackup(
const std::vector<pair<string, string> > &resources,
const std::vector<std::string> &versions,
const std::string &profile );
90 bool RemoveBackup(
const std::vector<pair<string, string> > &resources,
const std::vector<std::string> &versions,
const std::string &profile );
91 bool ListBackups(
const std::string &profile, std::vector<backup_info_t> *reslist );
92 bool AddBackup(
const std::vector<pair<string, string> > &resources,
const std::string &profile);
93 bool Recover(
bool rollback=
false );
99 struct prepare_failed{};
101 std::vector<resource_group_t> &GetGroupsByResource(
const std::string &resname,
const std::string &restype );
102 void Prepare(
bool write_access=
false );
107 bool switch_prepared;
bool GetConfigOption(const std::string &option, std::string &value)
Sets a configuartion option.
bool CopyResourceSet(std::string set, std::string newset)
Copies a resource set.
bool Set(std::string command, std::string argument, std::string profile="")
Set profile options.
variable type for profile switch information
Definition: scpm_types.h:63
bool DeleteResourceSet(std::string set)
Deletes an individual resource set.
bool DeactivateResourceGroup(const std::string &group, bool auto_remove=false)
Deactivates a resource group.
bool Delete(std::string profile)
Deletes a profile.
bool RenameResourceGroup(const std::string &group, const std::string &newgroup)
Renames a resource group.
bool ActivateResourceGroup(const std::string &group, bool auto_add=false)
Activates a resource group.
bool Create(std::string profile, std::string source_profile)
Adds a new profile.
bool Disable()
Completely disables SCPM.
bool RebuildDB(rebuild_mode_t mode=REBUILD_MODE_QUICK)
Performs a rebuild of the database.
bool Add(std::string profile, bool auto_switch=true)
Adds a new profile.
bool Enable(bool force=false)
Makes SCPM ready for use.
bool SetConfigOption(const std::string &option, const std::string &value)
Sets a configuartion option.
bool List(std::vector< std::string > &profiles)
lists all profiles
bool ListResourceGroups(std::vector< resource_group_t > &groups)
Generates a list of all installed resource groups.
SCPM(int options=0, std::ostream &info_out=cout, std::ostream &hash_out=cout, std::string root="")
Constructor.
bool Switch(switch_info_t &switch_info)
Perform prepared switch.
transport container for SCPM status information
Definition: scpm_types.h:69
bool Modify(std::string profile, std::string action)
Perform a profile modify action.
bool DeleteResourceGroup(const std::string &group)
Removes a resource group.
bool SetResourceGroup(const std::string &name, const std::vector< resource_entry_t > &group, const std::string &description)
Modifies or creates a resource group.
Some variable types used by SCPM.
bool GetResourceSet(std::string &set)
Gets the active resource set.
bool ResetResourceGroup(const std::string &group)
Resets defaults of a resource group.
bool Status(scpm_status_t &status)
Query some status information.
bool ResetAllGroups()
Resets all resource groups.
bool SetActiveResourceGroups(const std::vector< std::string > &groups)
Sets active resource groups.
bool Copy(std::string source_profile, std::string profile)
Adds a new profile.
bool Rename(std::string profile, std::string newprofile)
Renames a profile.
bool Get(std::string command, std::string &result, std::string profile="")
Get profile options.
Removes obsolete resources and adds new ones.
Definition: scpm_types.h:92
bool Active(std::string &profile)
query for active profile
SCPM interface class.
Definition: scpm.h:29
bool ListResourceSets(std::vector< std::string > &predefined, std::vector< std::string > &individual)
Gets all defined resource sets.
rebuild_mode_t
Rebuild mode enum.
Definition: scpm_types.h:91
bool ShowChanges(std::ostream &output, std::string resource_type, std::string resource_name, bool backup=false, string version="")
Shows changes of given resource.
bool GetActiveResourceGroups(std::vector< std::string > &groups)
Lists active resource groups.
bool Save(switch_info_t &switch_info)
Save modified resources.
bool PrepareSwitch(std::string profile, switch_info_t &switch_info)
Prepares the switch to profile profile
bool SetResourceSet(std::string set)
Sets a resource set for use.
bool Reload()
Reloads the current profile.