From 99b007f37e13d10fd3d994e6fccd6d06bcbaea8a Mon Sep 17 00:00:00 2001 From: "Robin.Mueller" Date: Mon, 14 Jun 2021 14:37:38 +0200 Subject: [PATCH 1/2] added deletions --- memory/GenericFileSystemMessage.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/memory/GenericFileSystemMessage.cpp b/memory/GenericFileSystemMessage.cpp index e4edc7ac..005f4ede 100644 --- a/memory/GenericFileSystemMessage.cpp +++ b/memory/GenericFileSystemMessage.cpp @@ -1,5 +1,7 @@ #include "GenericFileSystemMessage.h" +#include "../objectmanager/ObjectManager.h" +#include "../storagemanager/StorageManagerIF.h" void GenericFileSystemMessage::setCreateFileCommand(CommandMessage* message, store_address_t storeId) { @@ -132,5 +134,28 @@ bool GenericFileSystemMessage::getReadReply(const CommandMessage *message, } ReturnValue_t GenericFileSystemMessage::clear(CommandMessage* message) { + switch(message->getCommand()) { + case(CMD_CREATE_FILE): + case(CMD_DELETE_FILE): + case(CMD_CREATE_DIRECTORY): + case(CMD_REPORT_FILE_ATTRIBUTES): + case(REPLY_REPORT_FILE_ATTRIBUTES): + case(CMD_LOCK_FILE): + case(CMD_UNLOCK_FILE): + case(CMD_COPY_FILE): + case(REPLY_READ_FROM_FILE): + case(CMD_READ_FROM_FILE): + case(CMD_APPEND_TO_FILE): + case(CMD_FINISH_APPEND_TO_FILE): + case(REPLY_READ_FINISHED_STOP): + case(REPLY_FINISH_APPEND): { + store_address_t storeId = GenericFileSystemMessage::getStoreId(message); + auto ipcStore = ObjectManager::instance()->get(objects::IPC_STORE); + if(ipcStore == nullptr) { + return HasReturnvaluesIF::RETURN_FAILED; + } + return ipcStore->deleteData(storeId); + } + } return HasReturnvaluesIF::RETURN_OK; } From af99303eac5f6f98383c01538a9c9d18a1413537 Mon Sep 17 00:00:00 2001 From: "Robin.Mueller" Date: Mon, 14 Jun 2021 15:05:40 +0200 Subject: [PATCH 2/2] indentation --- memory/GenericFileSystemMessage.cpp | 46 ++++++++++++++--------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/memory/GenericFileSystemMessage.cpp b/memory/GenericFileSystemMessage.cpp index 005f4ede..b0e1a9ec 100644 --- a/memory/GenericFileSystemMessage.cpp +++ b/memory/GenericFileSystemMessage.cpp @@ -134,28 +134,28 @@ bool GenericFileSystemMessage::getReadReply(const CommandMessage *message, } ReturnValue_t GenericFileSystemMessage::clear(CommandMessage* message) { - switch(message->getCommand()) { - case(CMD_CREATE_FILE): - case(CMD_DELETE_FILE): - case(CMD_CREATE_DIRECTORY): - case(CMD_REPORT_FILE_ATTRIBUTES): - case(REPLY_REPORT_FILE_ATTRIBUTES): - case(CMD_LOCK_FILE): - case(CMD_UNLOCK_FILE): - case(CMD_COPY_FILE): - case(REPLY_READ_FROM_FILE): - case(CMD_READ_FROM_FILE): - case(CMD_APPEND_TO_FILE): - case(CMD_FINISH_APPEND_TO_FILE): - case(REPLY_READ_FINISHED_STOP): - case(REPLY_FINISH_APPEND): { - store_address_t storeId = GenericFileSystemMessage::getStoreId(message); - auto ipcStore = ObjectManager::instance()->get(objects::IPC_STORE); - if(ipcStore == nullptr) { - return HasReturnvaluesIF::RETURN_FAILED; - } - return ipcStore->deleteData(storeId); - } - } + switch(message->getCommand()) { + case(CMD_CREATE_FILE): + case(CMD_DELETE_FILE): + case(CMD_CREATE_DIRECTORY): + case(CMD_REPORT_FILE_ATTRIBUTES): + case(REPLY_REPORT_FILE_ATTRIBUTES): + case(CMD_LOCK_FILE): + case(CMD_UNLOCK_FILE): + case(CMD_COPY_FILE): + case(REPLY_READ_FROM_FILE): + case(CMD_READ_FROM_FILE): + case(CMD_APPEND_TO_FILE): + case(CMD_FINISH_APPEND_TO_FILE): + case(REPLY_READ_FINISHED_STOP): + case(REPLY_FINISH_APPEND): { + store_address_t storeId = GenericFileSystemMessage::getStoreId(message); + auto ipcStore = ObjectManager::instance()->get(objects::IPC_STORE); + if(ipcStore == nullptr) { + return HasReturnvaluesIF::RETURN_FAILED; + } + return ipcStore->deleteData(storeId); + } + } return HasReturnvaluesIF::RETURN_OK; }