mirror of
https://github.com/nasa/fprime.git
synced 2025-12-10 00:44:37 -06:00
Add file status (#3569)
* adding status for when Os::File should report no more resources * formatting * new enum values must also be added to the model fpp file
This commit is contained in:
parent
4ecc916dd9
commit
d26b2382a2
25
Os/File.hpp
25
Os/File.hpp
@ -27,18 +27,19 @@ class FileInterface {
|
||||
};
|
||||
|
||||
enum Status {
|
||||
OP_OK, //!< Operation was successful
|
||||
DOESNT_EXIST, //!< File doesn't exist (for read)
|
||||
NO_SPACE, //!< No space left
|
||||
NO_PERMISSION, //!< No permission to read/write file
|
||||
BAD_SIZE, //!< Invalid size parameter
|
||||
NOT_OPENED, //!< file hasn't been opened yet
|
||||
FILE_EXISTS, //!< file already exist (for CREATE with O_EXCL enabled)
|
||||
NOT_SUPPORTED, //!< Kernel or file system does not support operation
|
||||
INVALID_MODE, //!< Mode for file access is invalid for current operation
|
||||
INVALID_ARGUMENT, //!< Invalid argument passed in
|
||||
OTHER_ERROR, //!< A catch-all for other errors. Have to look in implementation-specific code
|
||||
MAX_STATUS //!< Maximum value of status
|
||||
OP_OK, //!< Operation was successful
|
||||
DOESNT_EXIST, //!< File doesn't exist (for read)
|
||||
NO_SPACE, //!< No space left
|
||||
NO_PERMISSION, //!< No permission to read/write file
|
||||
BAD_SIZE, //!< Invalid size parameter
|
||||
NOT_OPENED, //!< file hasn't been opened yet
|
||||
FILE_EXISTS, //!< file already exist (for CREATE with O_EXCL enabled)
|
||||
NOT_SUPPORTED, //!< Kernel or file system does not support operation
|
||||
INVALID_MODE, //!< Mode for file access is invalid for current operation
|
||||
INVALID_ARGUMENT, //!< Invalid argument passed in
|
||||
NO_MORE_RESOURCES, //!< No more available resources
|
||||
OTHER_ERROR, //!< A catch-all for other errors. Have to look in implementation-specific code
|
||||
MAX_STATUS //!< Maximum value of status
|
||||
};
|
||||
|
||||
enum OverwriteType {
|
||||
|
||||
@ -16,6 +16,7 @@ enum FileStatus {
|
||||
NOT_SUPPORTED, @< Kernel or file system does not support operation
|
||||
INVALID_MODE, @< Mode for file access is invalid for current operation
|
||||
INVALID_ARGUMENT, @< Invalid argument passed in
|
||||
NO_MORE_RESOURCES,@< No more available resources
|
||||
OTHER_ERROR, @< A catch-all for other errors. Have to look in implementation-specific code
|
||||
}
|
||||
@ FPP shadow-enum representing Os::File::Mode
|
||||
|
||||
@ -46,6 +46,8 @@ static_assert(static_cast<Os::FileStatus::T>(Os::File::Status::INVALID_MODE) ==
|
||||
"File status and FPP shadow enum do not match");
|
||||
static_assert(static_cast<Os::FileStatus::T>(Os::File::Status::INVALID_ARGUMENT) == Os::FileStatus::T::INVALID_ARGUMENT,
|
||||
"File status and FPP shadow enum do not match");
|
||||
static_assert(static_cast<Os::FileStatus::T>(Os::File::Status::NO_MORE_RESOURCES) == Os::FileStatus::T::NO_MORE_RESOURCES,
|
||||
"File status and FPP shadow enum do not match");
|
||||
static_assert(static_cast<Os::FileStatus::T>(Os::File::Status::OTHER_ERROR) == Os::FileStatus::T::OTHER_ERROR,
|
||||
"File status and FPP shadow enum do not match");
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user