BAGEL: Add some virtual and override keywords, change the signature of CBofFile::close()

This commit is contained in:
Strangerke 2024-05-31 22:46:38 +01:00
parent ebf42b4ceb
commit 0f0965998d
5 changed files with 11 additions and 11 deletions

View File

@ -150,7 +150,7 @@ public:
*/
ErrorCode getOption(const char *section, const char *option, bool *boolValue, int defaultValue);
void setAppName(const char *newAppName) {
void setAppName(const char *newAppName) override {
Common::strcpy_s(_szAppName, newAppName);
}

View File

@ -77,7 +77,7 @@ public:
virtual ErrorCode runApp();
virtual ErrorCode shutdown();
void setAppName(const char *pszNewAppName) {
virtual void setAppName(const char *pszNewAppName) {
Common::strcpy_s(_szAppName, pszNewAppName);
}

View File

@ -141,7 +141,7 @@ public:
* Closes current data-file, if it's not already closed
* @return Error return code
*/
ErrorCode close();
ErrorCode close() override;
/**
* Destroys current data-file, if any, and starts a new empty one
@ -220,7 +220,7 @@ public:
* @param lBytes Number of bytes
* @return Error code
*/
ErrorCode read(void *pDestBuf, int32 lBytes);
ErrorCode read(void *pDestBuf, int32 lBytes) override;
ErrorCode read(HeaderRec &rec);
ErrorCode read(HeadInfo &rec);
@ -230,7 +230,7 @@ public:
* @param lBytes Number of bytes
* @return Error code
*/
ErrorCode write(const void *pSrcBuf, int32 lBytes);
ErrorCode write(const void *pSrcBuf, int32 lBytes) override;
ErrorCode write(HeaderRec &rec);
ErrorCode write(HeadInfo &rec);
};

View File

@ -134,7 +134,7 @@ ErrorCode CBofFile::open(const char *pszFileName, uint32 lFlags) {
return _errCode;
}
void CBofFile::close() {
ErrorCode CBofFile::close() {
assert(isValidObject(this));
if (_stream != nullptr) {
@ -145,6 +145,8 @@ void CBofFile::close() {
delete _stream;
_stream = nullptr;
}
return ERR_NONE;
}
ErrorCode CBofFile::read(void *pDestBuf, int32 lBytes) {

View File

@ -136,7 +136,7 @@ public:
/**
* Close a currently open file
*/
void close();
virtual ErrorCode close();
/**
* Read from a currently open file
@ -144,7 +144,7 @@ public:
* @param lBytes Number of bytes
* @return Error code
*/
ErrorCode read(void *pDestBuf, int32 lBytes);
virtual ErrorCode read(void *pDestBuf, int32 lBytes);
/**
* Write to a currently open file
@ -152,15 +152,13 @@ public:
* @param lBytes Number of bytes
* @return Error code
*/
ErrorCode write(const void *pSrcBuf, int32 lBytes);
virtual ErrorCode write(const void *pSrcBuf, int32 lBytes);
/**
* Flushes I/O stream
*/
void commit();
//static void commitAll() { _flushall(); }
/**
* Seek to a specified location in the file
* @return Error code