all retval replacements
This commit is contained in:
@ -9,24 +9,24 @@ ReturnValue_t CfdpDistributor::registerTcDestination(const cfdp::EntityId& addre
|
||||
AcceptsTelecommandsIF& tcDest) {
|
||||
for (const auto& dest : tcDestinations) {
|
||||
if (dest.id == address) {
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
}
|
||||
tcDestinations.emplace_back(address, tcDest.getName(), tcDest.getRequestQueue());
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
ReturnValue_t CfdpDistributor::selectDestination(MessageQueueId_t& destId) {
|
||||
auto accessorPair = cfg.tcStore.getData(currentMessage.getStorageId());
|
||||
if (accessorPair.first != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (accessorPair.first != returnvalue::OK) {
|
||||
return accessorPair.first;
|
||||
}
|
||||
ReturnValue_t result = pduReader.setData(accessorPair.second.data(), accessorPair.second.size());
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
result = pduReader.parseData();
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
cfdp::EntityId foundId;
|
||||
@ -44,7 +44,7 @@ ReturnValue_t CfdpDistributor::selectDestination(MessageQueueId_t& destId) {
|
||||
}
|
||||
// Packet was forwarded successfully, so do not delete it.
|
||||
accessorPair.second.release();
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
const char* CfdpDistributor::getName() const { return "CFDP Distributor"; }
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "fsfw/cfdp/pdu/HeaderReader.h"
|
||||
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
|
||||
#include "fsfw/returnvalues/returnvalue.h"
|
||||
#include "fsfw/tcdistribution/CfdpPacketChecker.h"
|
||||
#include "fsfw/tcdistribution/TcDistributorBase.h"
|
||||
#include "fsfw/tmtcpacket/cfdp/CfdpPacketStored.h"
|
||||
@ -61,8 +61,8 @@ class CfdpDistributor : public TcDistributorBase, public AcceptsTelecommandsIF {
|
||||
MessageQueueId_t queueId;
|
||||
};
|
||||
HeaderReader pduReader;
|
||||
ReturnValue_t lastTcError = HasReturnvaluesIF::RETURN_OK;
|
||||
ReturnValue_t lastTmError = HasReturnvaluesIF::RETURN_OK;
|
||||
ReturnValue_t lastTcError = returnvalue::OK;
|
||||
ReturnValue_t lastTmError = returnvalue::OK;
|
||||
// I don't think a regular OBSW will have more than 1 or 2 of these destinations, so I think
|
||||
// it is okay to accept the overhead here
|
||||
std::vector<EntityInfo> tcDestinations;
|
||||
|
@ -61,4 +61,3 @@
|
||||
//};
|
||||
//
|
||||
//#endif /* FSFW_CFDP_CFDPHANDLER_H_ */
|
||||
|
||||
|
@ -23,30 +23,30 @@ ReturnValue_t cfdp::DestHandler::performStateMachine() {
|
||||
case TransactionStep::SENDING_FINISHED_PDU:
|
||||
break;
|
||||
}
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
ReturnValue_t cfdp::DestHandler::passPacket(PacketInfo packet) {
|
||||
if (p.packetListRef.full()) {
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
p.packetListRef.push_back(packet);
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
ReturnValue_t cfdp::DestHandler::initialize() {
|
||||
if (p.tmStore == nullptr) {
|
||||
p.tmStore = ObjectManager::instance()->get<StorageManagerIF>(objects::TM_STORE);
|
||||
if (p.tmStore == nullptr) {
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
}
|
||||
|
||||
if (p.tcStore == nullptr) {
|
||||
p.tcStore = ObjectManager::instance()->get<StorageManagerIF>(objects::TC_STORE);
|
||||
if (p.tcStore == nullptr) {
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
}
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ AckPduDeserializer::AckPduDeserializer(const uint8_t* pduBuf, size_t maxSize, Ac
|
||||
ReturnValue_t AckPduDeserializer::parseData() {
|
||||
ReturnValue_t result = FileDirectiveReader::parseData();
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
size_t currentIdx = FileDirectiveReader::getHeaderSize();
|
||||
if (currentIdx + 2 > this->maxSize) {
|
||||
|
@ -12,13 +12,13 @@ size_t FileDirectiveCreator::getSerializedSize() const {
|
||||
ReturnValue_t FileDirectiveCreator::serialize(uint8_t **buffer, size_t *size, size_t maxSize,
|
||||
Endianness streamEndianness) const {
|
||||
if (buffer == nullptr or size == nullptr) {
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
if (FileDirectiveCreator::getWholePduSize() > maxSize) {
|
||||
return BUFFER_TOO_SHORT;
|
||||
}
|
||||
ReturnValue_t result = HeaderCreator::serialize(buffer, size, maxSize, streamEndianness);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -28,7 +28,7 @@ ReturnValue_t FileDirectiveCreator::serialize(uint8_t **buffer, size_t *size, si
|
||||
**buffer = directiveCode;
|
||||
*buffer += 1;
|
||||
*size += 1;
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
void FileDirectiveCreator::setDirectiveDataFieldLen(size_t len) {
|
||||
|
@ -7,7 +7,7 @@ cfdp::FileDirectives FileDirectiveReader::getFileDirective() const { return file
|
||||
|
||||
ReturnValue_t FileDirectiveReader::parseData() {
|
||||
ReturnValue_t result = HeaderReader::parseData();
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
if (this->getPduDataFieldLen() < 1) {
|
||||
@ -21,7 +21,7 @@ ReturnValue_t FileDirectiveReader::parseData() {
|
||||
return cfdp::INVALID_DIRECTIVE_FIELDS;
|
||||
}
|
||||
setFileDirective(static_cast<cfdp::FileDirectives>(pointers.rawPtr[currentIdx]));
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
size_t FileDirectiveReader::getHeaderSize() const {
|
||||
|
@ -12,7 +12,7 @@ HeaderCreator::HeaderCreator(PduConfig &pduConf, cfdp::PduType pduType, size_t i
|
||||
ReturnValue_t HeaderCreator::serialize(uint8_t **buffer, size_t *size, size_t maxSize,
|
||||
Endianness streamEndianness) const {
|
||||
if (buffer == nullptr or size == nullptr) {
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
if (maxSize < this->getSerializedSize()) {
|
||||
return BUFFER_TOO_SHORT;
|
||||
@ -29,19 +29,19 @@ ReturnValue_t HeaderCreator::serialize(uint8_t **buffer, size_t *size, size_t ma
|
||||
*buffer += 1;
|
||||
*size += 4;
|
||||
ReturnValue_t result = pduConf.sourceId.serialize(buffer, size, maxSize, streamEndianness);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
result = pduConf.seqNum.serialize(buffer, size, maxSize, streamEndianness);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
result = pduConf.destId.serialize(buffer, size, maxSize, streamEndianness);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
size_t HeaderCreator::getSerializedSize() const {
|
||||
@ -51,7 +51,7 @@ size_t HeaderCreator::getSerializedSize() const {
|
||||
ReturnValue_t HeaderCreator::deSerialize(const uint8_t **buffer, size_t *size,
|
||||
Endianness streamEndianness) {
|
||||
// We could implement this, but I prefer dedicated classes
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
|
||||
size_t HeaderCreator::getWholePduSize() const {
|
||||
|
@ -8,7 +8,7 @@ HeaderReader::HeaderReader(const uint8_t *pduBuf, size_t maxSize) { setData(pduB
|
||||
|
||||
ReturnValue_t HeaderReader::parseData() {
|
||||
if (pointers.rawPtr == nullptr) {
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
if (maxSize < 7) {
|
||||
return SerializeIF::STREAM_TOO_SHORT;
|
||||
@ -20,19 +20,19 @@ ReturnValue_t HeaderReader::parseData() {
|
||||
cfdp::WidthInBytes widthSeqNum = getLenSeqNum();
|
||||
seqNumRaw = static_cast<uint8_t *>(sourceIdRaw) + static_cast<uint8_t>(widthEntityIds);
|
||||
destIdRaw = static_cast<uint8_t *>(seqNumRaw) + static_cast<uint8_t>(widthSeqNum);
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
ReturnValue_t HeaderReader::setData(uint8_t *dataPtr, size_t maxSize_, void *args) {
|
||||
if (dataPtr == nullptr) {
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
if (maxSize_ < 7) {
|
||||
return SerializeIF::STREAM_TOO_SHORT;
|
||||
}
|
||||
pointers.rawPtr = dataPtr;
|
||||
maxSize = maxSize_;
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
size_t HeaderReader::getHeaderSize() const {
|
||||
|
@ -7,7 +7,7 @@
|
||||
#include "fsfw/ipc/MessageQueueIF.h"
|
||||
#include "fsfw/ipc/messageQueueDefinitions.h"
|
||||
#include "fsfw/returnvalues/FwClassIds.h"
|
||||
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
|
||||
#include "fsfw/returnvalues/returnvalue.h"
|
||||
|
||||
struct FilesystemParams {
|
||||
explicit FilesystemParams(const char* path) : path(path) {}
|
||||
|
@ -36,7 +36,7 @@ ReturnValue_t CcsdsDistributor::selectDestination(MessageQueueId_t& destId) {
|
||||
#endif
|
||||
auto accessorPair = tcStore->getData(currentMessage.getStorageId());
|
||||
ReturnValue_t result = accessorPair.first;
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result != returnvalue::OK) {
|
||||
#if FSFW_VERBOSE_LEVEL >= 1
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||
sif::error << "CCSDSDistributor::selectDestination: Getting data from"
|
||||
@ -64,7 +64,7 @@ ReturnValue_t CcsdsDistributor::selectDestination(MessageQueueId_t& destId) {
|
||||
}
|
||||
SpacePacketReader currentPacket(accessorPair.second.data(), accessorPair.second.size());
|
||||
result = packetChecker->checkPacket(currentPacket, accessorPair.second.size());
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result != returnvalue::OK) {
|
||||
handlePacketCheckFailure(result);
|
||||
return result;
|
||||
}
|
||||
@ -90,7 +90,7 @@ ReturnValue_t CcsdsDistributor::selectDestination(MessageQueueId_t& destId) {
|
||||
return handleCcsdsHeaderRemoval(accessorPair.second);
|
||||
}
|
||||
accessorPair.second.release();
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
void CcsdsDistributor::handlePacketCheckFailure(ReturnValue_t result) {
|
||||
@ -116,10 +116,10 @@ void CcsdsDistributor::handlePacketCheckFailure(ReturnValue_t result) {
|
||||
MessageQueueId_t CcsdsDistributor::getRequestQueue() const { return tcQueue->getId(); }
|
||||
|
||||
ReturnValue_t CcsdsDistributor::registerApplication(DestInfo info) {
|
||||
ReturnValue_t returnValue = RETURN_OK;
|
||||
ReturnValue_t returnValue = returnvalue::OK;
|
||||
auto insertPair = receiverMap.emplace(info.apid, info);
|
||||
if (not insertPair.second) {
|
||||
returnValue = RETURN_FAILED;
|
||||
returnValue = returnvalue::FAILED;
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
@ -128,7 +128,7 @@ uint32_t CcsdsDistributor::getIdentifier() const { return 0; }
|
||||
|
||||
ReturnValue_t CcsdsDistributor::initialize() {
|
||||
ReturnValue_t result = TcDistributorBase::initialize();
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
if (packetChecker == nullptr) {
|
||||
@ -156,10 +156,10 @@ ReturnValue_t CcsdsDistributor::initialize() {
|
||||
}
|
||||
|
||||
ReturnValue_t CcsdsDistributor::callbackAfterSending(ReturnValue_t queueStatus) {
|
||||
if (queueStatus != RETURN_OK) {
|
||||
if (queueStatus != returnvalue::OK) {
|
||||
tcStore->deleteData(currentMessage.getStorageId());
|
||||
}
|
||||
return RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
void CcsdsDistributor::print() {
|
||||
@ -180,7 +180,7 @@ ReturnValue_t CcsdsDistributor::handleCcsdsHeaderRemoval(ConstStorageAccessor& a
|
||||
store_address_t newStoreId;
|
||||
ReturnValue_t result = tcStore->addData(&newStoreId, accessor.data() + ccsds::HEADER_LEN,
|
||||
accessor.size() - ccsds::HEADER_LEN);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result != returnvalue::OK) {
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||
sif::error << __func__ << ": TC store full" << std::endl;
|
||||
#else
|
||||
@ -190,5 +190,5 @@ ReturnValue_t CcsdsDistributor::handleCcsdsHeaderRemoval(ConstStorageAccessor& a
|
||||
}
|
||||
currentMessage.setStorageId(newStoreId);
|
||||
// The const accessor will delete the old data automatically
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
@ -27,8 +27,8 @@ ReturnValue_t PusDistributor::selectDestination(MessageQueueId_t& destId) {
|
||||
// TODO: Need to set the data
|
||||
const uint8_t* packetPtr = nullptr;
|
||||
size_t packetLen = 0;
|
||||
ReturnValue_t result = store->getData(currentMessage.getStorageId(), &packetPtr, &packetLen) !=
|
||||
returnvalue::OK;
|
||||
ReturnValue_t result =
|
||||
store->getData(currentMessage.getStorageId(), &packetPtr, &packetLen) != returnvalue::OK;
|
||||
if (result != returnvalue::OK) {
|
||||
tcStatus = PACKET_LOST;
|
||||
return result;
|
||||
|
@ -20,11 +20,11 @@ TcDistributorBase::~TcDistributorBase() {
|
||||
|
||||
ReturnValue_t TcDistributorBase::performOperation(uint8_t opCode) {
|
||||
ReturnValue_t status;
|
||||
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
|
||||
for (status = tcQueue->receiveMessage(¤tMessage); status == RETURN_OK;
|
||||
ReturnValue_t result = returnvalue::OK;
|
||||
for (status = tcQueue->receiveMessage(¤tMessage); status == returnvalue::OK;
|
||||
status = tcQueue->receiveMessage(¤tMessage)) {
|
||||
ReturnValue_t packetResult = handlePacket();
|
||||
if (packetResult != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (packetResult != returnvalue::OK) {
|
||||
result = packetResult;
|
||||
triggerEvent(tmtcdistrib::HANDLE_PACKET_FAILED, packetResult, 1);
|
||||
}
|
||||
@ -38,12 +38,12 @@ ReturnValue_t TcDistributorBase::performOperation(uint8_t opCode) {
|
||||
ReturnValue_t TcDistributorBase::handlePacket() {
|
||||
MessageQueueId_t destId;
|
||||
ReturnValue_t result = selectDestination(destId);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
return callbackAfterSending(tcQueue->sendMessage(destId, ¤tMessage));
|
||||
}
|
||||
|
||||
ReturnValue_t TcDistributorBase::callbackAfterSending(ReturnValue_t queueStatus) {
|
||||
return RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
namespace tmtcdistrib {
|
||||
static const uint8_t INTERFACE_ID = CLASS_ID::TMTC_DISTRIBUTION;
|
||||
static constexpr ReturnValue_t NO_DESTINATION_FOUND = result::makeCode(INTERFACE_ID, 0);
|
||||
static constexpr ReturnValue_t NO_DESTINATION_FOUND = returnvalue::makeCode(INTERFACE_ID, 0);
|
||||
static constexpr ReturnValue_t INVALID_CCSDS_VERSION = MAKE_RETURN_CODE(1);
|
||||
static constexpr ReturnValue_t INVALID_APID = MAKE_RETURN_CODE(2);
|
||||
static constexpr ReturnValue_t INVALID_PACKET_TYPE = MAKE_RETURN_CODE(3);
|
||||
|
@ -12,7 +12,7 @@ HostFilesystem::HostFilesystem() = default;
|
||||
|
||||
ReturnValue_t HostFilesystem::writeToFile(FileOpParams params, const uint8_t *data) {
|
||||
if (params.path() == nullptr) {
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
path path(params.path());
|
||||
if (not exists(path)) {
|
||||
@ -24,13 +24,13 @@ ReturnValue_t HostFilesystem::writeToFile(FileOpParams params, const uint8_t *da
|
||||
}
|
||||
file.seekp(static_cast<unsigned int>(params.offset));
|
||||
file.write(reinterpret_cast<const char *>(data), static_cast<unsigned int>(params.size));
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
ReturnValue_t HostFilesystem::readFromFile(FileOpParams params, uint8_t **buffer, size_t &readSize,
|
||||
size_t maxSize) {
|
||||
if (params.path() == nullptr) {
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
path path(params.path());
|
||||
if (not exists(path)) {
|
||||
@ -48,13 +48,13 @@ ReturnValue_t HostFilesystem::readFromFile(FileOpParams params, uint8_t **buffer
|
||||
file.read(reinterpret_cast<char *>(*buffer), sizeToRead);
|
||||
readSize += sizeToRead;
|
||||
*buffer += sizeToRead;
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
ReturnValue_t HostFilesystem::createFile(FilesystemParams params, const uint8_t *data,
|
||||
size_t size) {
|
||||
if (params.path == nullptr) {
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
path path(params.path);
|
||||
if (exists(path)) {
|
||||
@ -64,26 +64,26 @@ ReturnValue_t HostFilesystem::createFile(FilesystemParams params, const uint8_t
|
||||
if (file.fail()) {
|
||||
return HasFileSystemIF::GENERIC_FILE_ERROR;
|
||||
}
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
ReturnValue_t HostFilesystem::removeFile(const char *path_, FileSystemArgsIF *args) {
|
||||
if (path_ == nullptr) {
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
path path(path_);
|
||||
if (not exists(path)) {
|
||||
return HasFileSystemIF::FILE_DOES_NOT_EXIST;
|
||||
}
|
||||
if (remove(path, errorCode)) {
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
return HasFileSystemIF::GENERIC_FILE_ERROR;
|
||||
}
|
||||
|
||||
ReturnValue_t HostFilesystem::createDirectory(FilesystemParams params, bool createParentDirs) {
|
||||
if (params.path == nullptr) {
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
path dirPath(params.path);
|
||||
|
||||
@ -93,19 +93,19 @@ ReturnValue_t HostFilesystem::createDirectory(FilesystemParams params, bool crea
|
||||
|
||||
if (createParentDirs) {
|
||||
if (create_directories(dirPath, errorCode)) {
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
return HasFileSystemIF::GENERIC_DIR_ERROR;
|
||||
}
|
||||
if (create_directory(dirPath, errorCode)) {
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
return HasFileSystemIF::GENERIC_DIR_ERROR;
|
||||
}
|
||||
|
||||
ReturnValue_t HostFilesystem::removeDirectory(FilesystemParams params, bool deleteRecurively) {
|
||||
if (params.path == nullptr) {
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
path dirPath(params.path);
|
||||
if (not exists(dirPath)) {
|
||||
@ -116,11 +116,11 @@ ReturnValue_t HostFilesystem::removeDirectory(FilesystemParams params, bool dele
|
||||
}
|
||||
if (deleteRecurively) {
|
||||
if (remove_all(dirPath, errorCode)) {
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
} else {
|
||||
if (remove(dirPath, errorCode)) {
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
}
|
||||
// Error handling
|
||||
@ -133,7 +133,7 @@ ReturnValue_t HostFilesystem::removeDirectory(FilesystemParams params, bool dele
|
||||
ReturnValue_t HostFilesystem::rename(const char *oldPath_, const char *newPath_,
|
||||
FileSystemArgsIF *args) {
|
||||
if (oldPath_ == nullptr or newPath_ == nullptr) {
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
path oldPath(oldPath_);
|
||||
path newPath(newPath_);
|
||||
@ -142,5 +142,5 @@ ReturnValue_t HostFilesystem::rename(const char *oldPath_, const char *newPath_,
|
||||
if (errorCode) {
|
||||
return HasFileSystemIF::GENERIC_RENAME_ERROR;
|
||||
}
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
Reference in New Issue
Block a user