Remove unused GetType() from CBufferedFile and CAutoFile

GetType() is only called in tests, so it is unused and can be removed.
This commit is contained in:
MarcoFalke
2023-09-11 17:30:31 +02:00
parent 5c2b3cd4b8
commit fa2f2413b8
8 changed files with 16 additions and 22 deletions

View File

@@ -550,12 +550,10 @@ public:
class CAutoFile : public AutoFile
{
private:
const int nType;
const int nVersion;
public:
explicit CAutoFile(std::FILE* file, int type, int version, std::vector<std::byte> data_xor = {}) : AutoFile{file, std::move(data_xor)}, nType{type}, nVersion{version} {}
int GetType() const { return nType; }
explicit CAutoFile(std::FILE* file, int version, std::vector<std::byte> data_xor = {}) : AutoFile{file, std::move(data_xor)}, nVersion{version} {}
int GetVersion() const { return nVersion; }
template<typename T>
@@ -582,7 +580,6 @@ public:
class CBufferedFile
{
private:
const int nType;
const int nVersion;
FILE *src; //!< source file
@@ -632,8 +629,8 @@ private:
}
public:
CBufferedFile(FILE* fileIn, uint64_t nBufSize, uint64_t nRewindIn, int nTypeIn, int nVersionIn)
: nType(nTypeIn), nVersion(nVersionIn), nReadLimit(std::numeric_limits<uint64_t>::max()), nRewind(nRewindIn), vchBuf(nBufSize, std::byte{0})
CBufferedFile(FILE* fileIn, uint64_t nBufSize, uint64_t nRewindIn, int nVersionIn)
: nVersion{nVersionIn}, nReadLimit{std::numeric_limits<uint64_t>::max()}, nRewind{nRewindIn}, vchBuf(nBufSize, std::byte{0})
{
if (nRewindIn >= nBufSize)
throw std::ios_base::failure("Rewind limit must be less than buffer size");
@@ -650,7 +647,6 @@ public:
CBufferedFile& operator=(const CBufferedFile&) = delete;
int GetVersion() const { return nVersion; }
int GetType() const { return nType; }
void fclose()
{