From ef6cd173eb0c3d5b67fcc4eed6242124e74403ce Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 24 Jun 2024 03:34:12 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/Base/Reader.cpp | 4 ++-- src/Base/Writer.cpp | 14 ++++++++------ src/Base/Writer.h | 6 +++--- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/Base/Reader.cpp b/src/Base/Reader.cpp index 0375a0f172..8640c8eef3 100644 --- a/src/Base/Reader.cpp +++ b/src/Base/Reader.cpp @@ -264,8 +264,8 @@ bool Base::XMLReader::isEndOfDocument() const void Base::XMLReader::readEndElement(const char* ElementName, int level) { // if we are already at the end of the current element - if ( (ReadType == EndElement || ReadType == StartEndElement) && ElementName && LocalName == ElementName - && (level < 0 || level == Level)) { + if ((ReadType == EndElement || ReadType == StartEndElement) && ElementName + && LocalName == ElementName && (level < 0 || level == Level)) { return; } if (ReadType == EndDocument) { diff --git a/src/Base/Writer.cpp b/src/Base/Writer.cpp index dd4bc82497..d80af5a743 100644 --- a/src/Base/Writer.cpp +++ b/src/Base/Writer.cpp @@ -320,8 +320,9 @@ void Writer::decInd() indBuf[indent] = '\0'; } -void Writer::putNextEntry(const char *file, const char *obj) { - ObjectName = obj?obj:file; +void Writer::putNextEntry(const char* file, const char* obj) +{ + ObjectName = obj ? obj : file; } // ---------------------------------------------------------------------------- @@ -350,8 +351,9 @@ ZipWriter::ZipWriter(std::ostream& os) ZipStream.setf(ios::fixed, ios::floatfield); } -void ZipWriter::putNextEntry(const char *file, const char *obj) { - Writer::putNextEntry(file,obj); +void ZipWriter::putNextEntry(const char* file, const char* obj) +{ + Writer::putNextEntry(file, obj); ZipStream.putNextEntry(file); } @@ -384,9 +386,9 @@ FileWriter::FileWriter(const char* DirName) FileWriter::~FileWriter() = default; -void FileWriter::putNextEntry(const char* file, const char *obj) +void FileWriter::putNextEntry(const char* file, const char* obj) { - Writer::putNextEntry(file,obj); + Writer::putNextEntry(file, obj); std::string fileName = DirName + "/" + file; this->FileStream.open(fileName.c_str(), std::ios::out | std::ios::binary); diff --git a/src/Base/Writer.h b/src/Base/Writer.h index 6a5be624c4..5ca61be9df 100644 --- a/src/Base/Writer.h +++ b/src/Base/Writer.h @@ -69,7 +69,7 @@ public: int getFileVersion() const; /// put the next entry with a give name - virtual void putNextEntry(const char *filename, const char *objName=nullptr); + virtual void putNextEntry(const char* filename, const char* objName = nullptr); /// insert a file as CDATA section in the XML file void insertAsciiFile(const char* FileName); @@ -209,7 +209,7 @@ public: { ZipStream.setLevel(level); } - void putNextEntry(const char *filename, const char *objName=nullptr) override; + void putNextEntry(const char* filename, const char* objName = nullptr) override; ZipWriter(const ZipWriter&) = delete; ZipWriter(ZipWriter&&) = delete; @@ -256,7 +256,7 @@ public: explicit FileWriter(const char* DirName); ~FileWriter() override; - void putNextEntry(const char *filename, const char *objName=nullptr) override; + void putNextEntry(const char* filename, const char* objName = nullptr) override; void writeFiles() override; std::ostream& Stream() override