delete directory: recursive option

This commit is contained in:
Robin Müller 2021-07-12 17:39:15 +02:00
parent 323577cdc6
commit da8a447073
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
3 changed files with 13 additions and 3 deletions

View File

@ -34,8 +34,9 @@ void GenericFileSystemMessage::setReportFileAttributesReply(CommandMessage *mess
}
void GenericFileSystemMessage::setDeleteDirectoryCommand(CommandMessage* message,
store_address_t storeId) {
store_address_t storeId, bool deleteRecursively) {
message->setCommand(CMD_DELETE_DIRECTORY);
message->setParameter(deleteRecursively);
message->setParameter2(storeId.raw);
}
@ -133,6 +134,12 @@ bool GenericFileSystemMessage::getReadReply(const CommandMessage *message,
return message->getParameter();
}
store_address_t GenericFileSystemMessage::getDeleteDirectoryCommand(const CommandMessage *message,
bool &deleteRecursively) {
deleteRecursively = message->getParameter();
return getStoreId(message);
}
ReturnValue_t GenericFileSystemMessage::clear(CommandMessage* message) {
switch(message->getCommand()) {
case(CMD_CREATE_FILE):

View File

@ -79,7 +79,9 @@ public:
static void setCreateDirectoryCommand(CommandMessage* message,
store_address_t storeId);
static void setDeleteDirectoryCommand(CommandMessage* message,
store_address_t storeId);
store_address_t storeId, bool deleteRecursively);
static store_address_t getDeleteDirectoryCommand(const CommandMessage* message,
bool& deleteRecursively);
static void setSuccessReply(CommandMessage* message);
static void setFailureReply(CommandMessage* message,

View File

@ -97,7 +97,8 @@ public:
* @param repositoryPath
* @param args Any other arguments which an implementation might require
*/
virtual ReturnValue_t removeDirectory(const char* repositoryPath, void* args = nullptr) = 0;
virtual ReturnValue_t removeDirectory(const char* repositoryPath,
bool deleteRecurively = false, void* args = nullptr) = 0;
};