diff options
-rw-r--r-- | parameter/ConfigurableDomains.cpp | 8 | ||||
-rw-r--r-- | parameter/ConfigurableDomains.h | 1 | ||||
-rw-r--r-- | parameter/ParameterMgr.cpp | 22 | ||||
-rw-r--r-- | parameter/ParameterMgr.h | 2 |
4 files changed, 33 insertions, 0 deletions
diff --git a/parameter/ConfigurableDomains.cpp b/parameter/ConfigurableDomains.cpp index 28611d3..706767b 100644 --- a/parameter/ConfigurableDomains.cpp +++ b/parameter/ConfigurableDomains.cpp @@ -157,6 +157,14 @@ bool CConfigurableDomains::deleteDomain(const string& strName, string& strError) return true; } +void CConfigurableDomains::deleteAllDomains() +{ + log("Deleting all configurable domains"); + + //remove Children + clean(); +} + bool CConfigurableDomains::renameDomain(const string& strName, const string& strNewName, string& strError) { CConfigurableDomain* pConfigurableDomain = findConfigurableDomain(strName, strError); diff --git a/parameter/ConfigurableDomains.h b/parameter/ConfigurableDomains.h index 262d900..bafcbfb 100644 --- a/parameter/ConfigurableDomains.h +++ b/parameter/ConfigurableDomains.h @@ -48,6 +48,7 @@ public: /// Domains bool createDomain(const string& strName, string& strError); bool deleteDomain(const string& strName, string& strError); + void deleteAllDomains(); bool renameDomain(const string& strName, const string& strNewName, string& strError); bool setSequenceAwareness(const string& strDomain, bool bSequenceAware, string& strError); bool getSequenceAwareness(const string& strDomain, bool& bSequenceAware, string& strError) const; diff --git a/parameter/ParameterMgr.cpp b/parameter/ParameterMgr.cpp index dc38f95..c1538df 100644 --- a/parameter/ParameterMgr.cpp +++ b/parameter/ParameterMgr.cpp @@ -132,6 +132,7 @@ const CParameterMgr::SRemoteCommandParserItem CParameterMgr::gastRemoteCommandPa { "dumpDomains", &CParameterMgr::dumpDomainsCommmandProcess, 0, "", "Show all domains and configurations, including applicability conditions" }, { "createDomain", &CParameterMgr::createDomainCommmandProcess, 1, "<domain>", "Create new configurable domain" }, { "deleteDomain", &CParameterMgr::deleteDomainCommmandProcess, 1, "<domain>", "Delete configurable domain" }, + { "deleteAllDomains", &CParameterMgr::deleteAllDomainsCommmandProcess, 0, "", "Delete all configurable domains" }, { "renameDomain", &CParameterMgr::renameDomainCommmandProcess, 2, "<domain> <new name>", "Rename configurable domain" }, { "setSequenceAwareness", &CParameterMgr::setSequenceAwarenessCommmandProcess, 1, "<domain> true|false*", "Set configurable domain sequence awareness" }, { "getSequenceAwareness", &CParameterMgr::getSequenceAwarenessCommmandProcess, 1, "<domain>", "Get configurable domain sequence awareness" }, @@ -872,6 +873,13 @@ CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::deleteDomainCommman return deleteDomain(remoteCommand.getArgument(0), strResult) ? CCommandHandler::EDone : CCommandHandler::EFailed; } +CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::deleteAllDomainsCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult) +{ + (void)remoteCommand; + + return deleteAllDomains(strResult) ? CCommandHandler::EDone : CCommandHandler::EFailed; +} + CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::renameDomainCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult) { return getConfigurableDomains()->renameDomain(remoteCommand.getArgument(0), remoteCommand.getArgument(1), strResult) ? CCommandHandler::EDone : CCommandHandler::EFailed; @@ -1447,6 +1455,20 @@ bool CParameterMgr::deleteDomain(const string& strName, string& strError) return getConfigurableDomains()->deleteDomain(strName, strError); } +bool CParameterMgr::deleteAllDomains(string& strError) +{ + // Check tuning mode + if (!checkTuningModeOn(strError)) { + + return false; + } + + // Delegate to configurable domains + getConfigurableDomains()->deleteAllDomains(); + + return true; +} + bool CParameterMgr::createConfiguration(const string& strDomain, const string& strConfiguration, string& strError) { // Check tuning mode diff --git a/parameter/ParameterMgr.h b/parameter/ParameterMgr.h index 1a5ebf2..a694bf4 100644 --- a/parameter/ParameterMgr.h +++ b/parameter/ParameterMgr.h @@ -144,6 +144,7 @@ public: // Creation/Deletion bool createDomain(const string& strName, string& strError); bool deleteDomain(const string& strName, string& strError); + bool deleteAllDomains(string& strError); bool createConfiguration(const string& strDomain, const string& strConfiguration, string& strError); bool deleteConfiguration(const string& strDomain, const string& strConfiguration, string& strError); @@ -202,6 +203,7 @@ private: CCommandHandler::CommandStatus listDomainsCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult); CCommandHandler::CommandStatus createDomainCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult); CCommandHandler::CommandStatus deleteDomainCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult); + CCommandHandler::CommandStatus deleteAllDomainsCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult); CCommandHandler::CommandStatus renameDomainCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult); CCommandHandler::CommandStatus setSequenceAwarenessCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult); CCommandHandler::CommandStatus getSequenceAwarenessCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult); |