diff --git a/BaseLib/CMakeLists.txt b/BaseLib/CMakeLists.txt index cd973a28f8a653809c100315625c2903044d5282..0db5a1ac0b827e1acc8571e8f64c29132697df13 100644 --- a/BaseLib/CMakeLists.txt +++ b/BaseLib/CMakeLists.txt @@ -1,4 +1,7 @@ GET_SOURCE_FILES(SOURCES) +GET_SOURCE_FILES(SOURCES_IO IO) + +set(SOURCES ${SOURCES} ${SOURCES_IO}) list(APPEND SOURCES "${CMAKE_CURRENT_BINARY_DIR}/BuildInfo.cpp" BuildInfo.h) diff --git a/FileIO/Writer.cpp b/BaseLib/IO/Writer.cpp similarity index 94% rename from FileIO/Writer.cpp rename to BaseLib/IO/Writer.cpp index 8b03518937b7c13d997948dbd0b86e84ef906aee..9ae1fe21c3b358003d1521834ece36e152675e55 100644 --- a/FileIO/Writer.cpp +++ b/BaseLib/IO/Writer.cpp @@ -19,7 +19,9 @@ #include <fstream> #include <limits> -namespace FileIO +namespace BaseLib +{ +namespace IO { Writer::Writer() @@ -72,4 +74,5 @@ void Writer::setFormat(std::ios_base::fmtflags flags) _out.setf(flags); } -} // namespace FileIO +} // namespace IO +} // namespace BaseLib diff --git a/FileIO/Writer.h b/BaseLib/IO/Writer.h similarity index 95% rename from FileIO/Writer.h rename to BaseLib/IO/Writer.h index 94a4538cc1d5a9b318150363886e90c2c2fcd1af..2a6652391205107a1b9a9fffea2d7dd02a2148d8 100644 --- a/FileIO/Writer.h +++ b/BaseLib/IO/Writer.h @@ -18,7 +18,9 @@ #include <string> #include <sstream> -namespace FileIO +namespace BaseLib +{ +namespace IO { /// @brief Base class which enables writing an object to string, stringstream @@ -58,6 +60,7 @@ private: }; -} // namespace FileIO +} // namespace IO +} // namespace BaseLib #endif // WRITER_H diff --git a/FileIO/CMakeLists.txt b/FileIO/CMakeLists.txt index 71bc8c024f9730f086fad19a4e3e659ba9240b6a..7e9030809c272b458dc8d01ba38bff249509b073 100644 --- a/FileIO/CMakeLists.txt +++ b/FileIO/CMakeLists.txt @@ -19,8 +19,6 @@ set(SOURCES TetGenInterface.cpp TINInterface.h TINInterface.cpp - Writer.h - Writer.cpp writeMeshToFile.h writeMeshToFile.cpp ) diff --git a/FileIO/GMSHInterface.h b/FileIO/GMSHInterface.h index 9ac706ff741ffe8b822f0a056ee9772e3b51a785..5971665cf1cfee1c3f94e5aa5f8520eb54a7f9bd 100644 --- a/FileIO/GMSHInterface.h +++ b/FileIO/GMSHInterface.h @@ -19,11 +19,10 @@ #include <map> #include <string> -// FileIO -#include "Writer.h" -#include "GmshIO/GMSHPoint.h" -#include "GmshIO/GMSHPolygonTree.h" -#include "GmshIO/GMSHMeshDensityStrategy.h" +#include "BaseLib/IO/Writer.h" +#include "FileIO/GmshIO/GMSHPoint.h" +#include "FileIO/GmshIO/GMSHPolygonTree.h" +#include "FileIO/GmshIO/GMSHMeshDensityStrategy.h" #include "MathLib/LinAlg/Dense/DenseMatrix.h" @@ -55,7 +54,7 @@ enum class MeshDensityAlgorithm { /** * \brief Reads and writes GMSH-files to and from OGS data structures. */ -class GMSHInterface : public Writer +class GMSHInterface : public BaseLib::IO::Writer { public: diff --git a/FileIO/Legacy/MeshIO.h b/FileIO/Legacy/MeshIO.h index 1c5bfa60bf23b983bd39fb929c64749d7cf86479..257f49802454579e1e2d9f6fe1932183b85d10b3 100644 --- a/FileIO/Legacy/MeshIO.h +++ b/FileIO/Legacy/MeshIO.h @@ -21,7 +21,7 @@ #include <vector> #include <boost/optional.hpp> -#include "FileIO/Writer.h" +#include "BaseLib/IO/Writer.h" #include "MeshLib/MeshEnums.h" #include "MeshLib/PropertyVector.h" @@ -39,7 +39,7 @@ namespace FileIO namespace Legacy { /// Interface for handling mesh files from OGS-5 and below. (*.msh files) -class MeshIO : public Writer +class MeshIO : public BaseLib::IO::Writer { public: /// Constructor. diff --git a/FileIO/XmlIO/Qt/XmlGspInterface.cpp b/FileIO/XmlIO/Qt/XmlGspInterface.cpp index ee51b8121a5b30f49618d8321c94fa4f5cfd72f9..6ea431c7f3eab7c58fc548f86c8f749486ea3492 100644 --- a/FileIO/XmlIO/Qt/XmlGspInterface.cpp +++ b/FileIO/XmlIO/Qt/XmlGspInterface.cpp @@ -26,8 +26,8 @@ #include "BaseLib/FileTools.h" #include "BaseLib/FileFinder.h" +#include "BaseLib/IO/Writer.h" -#include "FileIO/Writer.h" #include "FileIO/Legacy/MeshIO.h" #include "FileIO/readMeshFromFile.h" #include "MeshLib/Mesh.h" @@ -109,7 +109,7 @@ int XmlGspInterface::readFile(const QString &fileName) int XmlGspInterface::writeToFile(const std::string& filename) { _filename = filename; - return FileIO::Writer::writeToFile(filename); + return BaseLib::IO::Writer::writeToFile(filename); } bool XmlGspInterface::write() diff --git a/FileIO/XmlIO/XMLInterface.h b/FileIO/XmlIO/XMLInterface.h index 4531c6af868a52d75905cec38fd3164b28845897..6527c61f47543df2b9e652ea15f072121afa0dc3 100644 --- a/FileIO/XmlIO/XMLInterface.h +++ b/FileIO/XmlIO/XMLInterface.h @@ -17,14 +17,14 @@ #include <string> -#include "FileIO/Writer.h" +#include "BaseLib/IO/Writer.h" namespace FileIO { /** * \brief Base class for writing any information to and from XML files. */ -class XMLInterface : public Writer +class XMLInterface : public BaseLib::IO::Writer { public: XMLInterface();