diff options
| author | Dan Goodliffe <dan@randomdan.homeip.net> | 2019-02-02 13:16:45 +0000 | 
|---|---|---|
| committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2019-02-02 13:16:45 +0000 | 
| commit | d3be9498357eb3ebd0f7e682e25f780f060af727 (patch) | |
| tree | cabb29a80eb41903db204a91bfcc6faff0a4d251 | |
| parent | Single definition of Ice libs (diff) | |
| download | slicer-d3be9498357eb3ebd0f7e682e25f780f060af727.tar.bz2 slicer-d3be9498357eb3ebd0f7e682e25f780f060af727.tar.xz slicer-d3be9498357eb3ebd0f7e682e25f780f060af727.zip  | |
Remove boost::filesystem in favour of std::filesystem
| -rw-r--r-- | slicer/db/Jamfile.jam | 15 | ||||
| -rw-r--r-- | slicer/ice/Jamfile.jam | 6 | ||||
| -rw-r--r-- | slicer/json/Jamfile.jam | 7 | ||||
| -rw-r--r-- | slicer/json/serializer.cpp | 4 | ||||
| -rw-r--r-- | slicer/json/serializer.h | 8 | ||||
| -rw-r--r-- | slicer/slicer/Jamfile.jam | 7 | ||||
| -rw-r--r-- | slicer/slicer/serializer.cpp | 6 | ||||
| -rw-r--r-- | slicer/slicer/serializer.h | 6 | ||||
| -rw-r--r-- | slicer/test/Jamfile.jam | 6 | ||||
| -rw-r--r-- | slicer/test/helpers.cpp | 2 | ||||
| -rw-r--r-- | slicer/test/helpers.h | 4 | ||||
| -rw-r--r-- | slicer/test/preprocessor.cpp | 2 | ||||
| -rw-r--r-- | slicer/test/serializers.cpp | 12 | ||||
| -rw-r--r-- | slicer/tool/Jamfile.jam | 6 | ||||
| -rw-r--r-- | slicer/tool/parser.cpp | 7 | ||||
| -rw-r--r-- | slicer/tool/parser.h | 10 | ||||
| -rw-r--r-- | slicer/xml/Jamfile.jam | 7 | ||||
| -rw-r--r-- | slicer/xml/serializer.cpp | 4 | ||||
| -rw-r--r-- | slicer/xml/serializer.h | 8 | 
19 files changed, 53 insertions, 74 deletions
diff --git a/slicer/db/Jamfile.jam b/slicer/db/Jamfile.jam index 67226fb..7bf1d3d 100644 --- a/slicer/db/Jamfile.jam +++ b/slicer/db/Jamfile.jam @@ -4,8 +4,7 @@ import ../test/slicer.jam ;  lib dbppcore : : : : <include>/usr/include/dbpp ;  lib dbpp-postgresql : : : : <include>/usr/include/dbpp-postgresql ; -lib boost_system ; -lib boost_filesystem ; +lib stdc++fs ;  lib boost_utf : : <name>boost_unit_test_framework ;  lib slicer-db : @@ -47,8 +46,7 @@ run testSelect.cpp  	<library>slicer-db  	<implicit-dependency>slicer-db  	<library>dbpp-postgresql -	<library>boost_system -	<library>boost_filesystem +	<library>stdc++fs  	<library>boost_utf  	<library>../test//types  	<library>../test//common @@ -67,8 +65,7 @@ run testInsert.cpp  	<define>BOOST_TEST_DYN_LINK  	<library>slicer-db  	<library>dbpp-postgresql -	<library>boost_system -	<library>boost_filesystem +	<library>stdc++fs  	<library>boost_utf  	<library>../test//types  	<library>../test//common @@ -87,8 +84,7 @@ run testPatch.cpp  	<define>BOOST_TEST_DYN_LINK  	<library>slicer-db  	<library>dbpp-postgresql -	<library>boost_system -	<library>boost_filesystem +	<library>stdc++fs  	<library>boost_utf  	<library>../test//types  	<library>../test//common @@ -106,8 +102,7 @@ run testUpdate.cpp  	<library>slicer-db  	<implicit-dependency>slicer-db  	<library>dbpp-postgresql -	<library>boost_system -	<library>boost_filesystem +	<library>stdc++fs  	<library>boost_utf  	<library>../test//types  	<library>../test//common diff --git a/slicer/ice/Jamfile.jam b/slicer/ice/Jamfile.jam index 82e7427..32ff6f4 100644 --- a/slicer/ice/Jamfile.jam +++ b/slicer/ice/Jamfile.jam @@ -1,16 +1,14 @@  import testing ;  import package ; -lib boost_system ; -lib boost_filesystem ; +lib stdc++fs ;  lib boost_utf : : <name>boost_unit_test_framework ;  lib slicer-ice :  	[ glob *.cpp : test*.cpp ]  	:  	<include>.. -	<library>boost_system -	<library>boost_filesystem +	<library>stdc++fs  	<library>..//Ice  	<library>..//adhocutil  	<library>../slicer//slicer diff --git a/slicer/json/Jamfile.jam b/slicer/json/Jamfile.jam index ae85792..0f972a3 100644 --- a/slicer/json/Jamfile.jam +++ b/slicer/json/Jamfile.jam @@ -5,16 +5,14 @@ lib jsonpp : : : :  	<library>../..//glibmm  	; -lib boost_system ; -lib boost_filesystem ; +lib stdc++fs ;  lib boost_utf : : <name>boost_unit_test_framework ;  lib slicer-json :  	[ glob *.cpp : test*.cpp ]  	:  	<include>.. -	<library>boost_system -	<library>boost_filesystem +	<library>stdc++fs  	<library>jsonpp  	<library>../..//glibmm  	<library>..//adhocutil @@ -27,6 +25,7 @@ run testSpecifics.cpp  	: : :  	<define>BOOST_TEST_DYN_LINK  	<library>slicer-json +	<library>stdc++fs  	<library>boost_utf  	<library>../test//types  	<library>../test//common diff --git a/slicer/json/serializer.cpp b/slicer/json/serializer.cpp index cd9b6b0..24cc746 100644 --- a/slicer/json/serializer.cpp +++ b/slicer/json/serializer.cpp @@ -330,12 +330,12 @@ namespace Slicer {  		json::serializeValue(doc, strm, "utf-8");  	} -	JsonFileSerializer::JsonFileSerializer(const boost::filesystem::path & p) : +	JsonFileSerializer::JsonFileSerializer(const std::filesystem::path & p) :  		path(p)  	{  	} -	JsonFileDeserializer::JsonFileDeserializer(const boost::filesystem::path & p) : +	JsonFileDeserializer::JsonFileDeserializer(const std::filesystem::path & p) :  		path(p)  	{  	} diff --git a/slicer/json/serializer.h b/slicer/json/serializer.h index c096dca..15157d4 100644 --- a/slicer/json/serializer.h +++ b/slicer/json/serializer.h @@ -26,12 +26,12 @@ namespace Slicer {  	class DLL_PUBLIC JsonFileSerializer : public JsonSerializer {  		public: -			JsonFileSerializer(const boost::filesystem::path &); +			JsonFileSerializer(const std::filesystem::path &);  			virtual void Serialize(ModelPartForRootPtr) override;  		protected: -			const boost::filesystem::path path; +			const std::filesystem::path path;  	};  	class DLL_PUBLIC JsonValueSerializer : public JsonSerializer { @@ -56,12 +56,12 @@ namespace Slicer {  	class DLL_PUBLIC JsonFileDeserializer : public Deserializer {  		public: -			JsonFileDeserializer(const boost::filesystem::path &); +			JsonFileDeserializer(const std::filesystem::path &);  			virtual void Deserialize(ModelPartForRootPtr) override;  		protected: -			const boost::filesystem::path path; +			const std::filesystem::path path;  	};  	class DLL_PUBLIC JsonValueDeserializer : public Deserializer { diff --git a/slicer/slicer/Jamfile.jam b/slicer/slicer/Jamfile.jam index c513768..d4ee48e 100644 --- a/slicer/slicer/Jamfile.jam +++ b/slicer/slicer/Jamfile.jam @@ -1,21 +1,18 @@  import package ; -lib boost_system ; -lib boost_filesystem ; +lib stdc++fs ;  lib slicer :  	[ glob *.cpp ]  	[ glob *.ice ]  	:  	<library>..//Ice -	<library>boost_system  	<library>..//adhocutil  	<include>..  	: :  	<include>..  	<include>. -	<library>boost_system -	<library>boost_filesystem +	<library>stdc++fs  	;  alias install : install-lib install-slice ; diff --git a/slicer/slicer/serializer.cpp b/slicer/slicer/serializer.cpp index 4856350..ad64fd9 100644 --- a/slicer/slicer/serializer.cpp +++ b/slicer/slicer/serializer.cpp @@ -1,10 +1,8 @@ -#define BOOST_FILESYSTEM_DYN_LINK -#define BOOST_FILESYSTEM_SOURCE  #include "serializer.h"  #include <factory.impl.h>  INSTANTIATEFACTORY(Slicer::Serializer, std::ostream &);  INSTANTIATEFACTORY(Slicer::Deserializer, std::istream &); -INSTANTIATEFACTORY(Slicer::Serializer, const boost::filesystem::path &); -INSTANTIATEFACTORY(Slicer::Deserializer, const boost::filesystem::path &); +INSTANTIATEFACTORY(Slicer::Serializer, const std::filesystem::path &); +INSTANTIATEFACTORY(Slicer::Deserializer, const std::filesystem::path &); diff --git a/slicer/slicer/serializer.h b/slicer/slicer/serializer.h index f4ed4a2..857fa65 100644 --- a/slicer/slicer/serializer.h +++ b/slicer/slicer/serializer.h @@ -1,7 +1,7 @@  #ifndef SLICER_SERIALIZER_H  #define SLICER_SERIALIZER_H -#include <boost/filesystem/path.hpp> +#include <filesystem>  #include <slicer/modelParts.h>  #include <visibility.h>  #include <factory.h> @@ -25,8 +25,8 @@ namespace Slicer {  	typedef AdHoc::Factory<Serializer, std::ostream &> StreamSerializerFactory;  	typedef AdHoc::Factory<Deserializer, std::istream &> StreamDeserializerFactory; -	typedef AdHoc::Factory<Serializer, const boost::filesystem::path &> FileSerializerFactory; -	typedef AdHoc::Factory<Deserializer, const boost::filesystem::path &> FileDeserializerFactory; +	typedef AdHoc::Factory<Serializer, const std::filesystem::path &> FileSerializerFactory; +	typedef AdHoc::Factory<Deserializer, const std::filesystem::path &> FileDeserializerFactory;  }  #endif diff --git a/slicer/test/Jamfile.jam b/slicer/test/Jamfile.jam index 8984242..ee6ca66 100644 --- a/slicer/test/Jamfile.jam +++ b/slicer/test/Jamfile.jam @@ -2,8 +2,7 @@ import testing ;  import ./slicer.jam ;  lib dl ; -lib boost_system ; -lib boost_filesystem ; +lib stdc++fs ;  lib boost_date_time ;  lib boost_utf : : <name>boost_unit_test_framework ; @@ -30,8 +29,7 @@ lib types :  path-constant me : . ;  alias common : : : : -	<library>boost_filesystem -	<library>boost_system +	<library>stdc++fs  	<define>BOOST_TEST_DYN_LINK  	<library>boost_utf  	<implicit-dependency>types diff --git a/slicer/test/helpers.cpp b/slicer/test/helpers.cpp index 956b626..cbc6623 100644 --- a/slicer/test/helpers.cpp +++ b/slicer/test/helpers.cpp @@ -3,7 +3,7 @@  #include <boost/test/test_tools.hpp>  void -diff(const boost::filesystem::path & left, const boost::filesystem::path & right) +diff(const std::filesystem::path & left, const std::filesystem::path & right)  {  	std::ifstream fl(left.string());  	std::ifstream fr(right.string()); diff --git a/slicer/test/helpers.h b/slicer/test/helpers.h index 95dbd4d..47754a9 100644 --- a/slicer/test/helpers.h +++ b/slicer/test/helpers.h @@ -3,12 +3,12 @@  #include <string>  #include <visibility.h> -#include <boost/filesystem/path.hpp> +#include <filesystem>  // These are just thin wrappers that throw exceptions  DLL_PUBLIC  void -diff(const boost::filesystem::path & left, const boost::filesystem::path & right); +diff(const std::filesystem::path & left, const std::filesystem::path & right);  #endif diff --git a/slicer/test/preprocessor.cpp b/slicer/test/preprocessor.cpp index ae93937..228ffe3 100644 --- a/slicer/test/preprocessor.cpp +++ b/slicer/test/preprocessor.cpp @@ -8,7 +8,7 @@  #include <definedDirs.h>  #include "helpers.h" -namespace fs = boost::filesystem; +namespace fs = std::filesystem;  typedef std::map<std::string, unsigned int> ComponentsCount;  ComponentsCount COMPONENTS_IN_TEST_ICE = { diff --git a/slicer/test/serializers.cpp b/slicer/test/serializers.cpp index 775f04e..097a3fb 100644 --- a/slicer/test/serializers.cpp +++ b/slicer/test/serializers.cpp @@ -8,8 +8,6 @@  #include <xml/serializer.h>  #include <libxml2/libxml/parser.h>  #include <json/serializer.h> -#include <boost/filesystem/operations.hpp> -#include <boost/filesystem/convenience.hpp>  #include <boost/format.hpp>  #include <functional>  #include <types.h> @@ -21,7 +19,7 @@  #include <definedDirs.h>  #include "conversions.h" -namespace fs = boost::filesystem; +namespace fs = std::filesystem;  namespace pl = std::placeholders;  // LCOV_EXCL_START @@ -53,8 +51,8 @@ class FileBased {  			const fs::path tmpf = binDir / "byFile";  			fs::create_directory(tmpf);  			const fs::path output = tmpf / infile; -			const fs::path outputJson = tmpf / fs::change_extension(infile, "json"); -			const fs::path outputXml = tmpf / fs::change_extension(infile, "xml"); +			const fs::path outputJson = tmpf / fs::path(infile).replace_extension("json"); +			const fs::path outputXml = tmpf / fs::path(infile).replace_extension("xml");  			BOOST_TEST_CHECKPOINT("Deserialize: " << input);  			T p = Slicer::DeserializeAny<DeserializerIn, T>(input); @@ -570,7 +568,7 @@ BOOST_AUTO_TEST_CASE( json_streams )  	const auto tmpf = binDir / "byStream";  	const auto inFile = rootDir / "initial" / "inherit-c.json";  	const auto outFile = tmpf / "streamout.json"; -	boost::filesystem::create_directories(tmpf); +	std::filesystem::create_directories(tmpf);  	{  		std::ifstream in(inFile.string());  		auto d = Slicer::DeserializeAny<Slicer::JsonStreamDeserializer, TestModule::InheritanceContPtr>(in); @@ -586,7 +584,7 @@ BOOST_AUTO_TEST_CASE( xml_streams )  	const auto tmpf = binDir / "byStream";  	const auto inFile = rootDir / "initial" / "inherit-b.xml";  	const auto outFile = tmpf / "streamout.xml"; -	boost::filesystem::create_directories(tmpf); +	fs::create_directories(tmpf);  	{  		std::ifstream in(inFile.string());  		auto d = Slicer::DeserializeAny<Slicer::XmlStreamDeserializer, TestModule::InheritanceContPtr>(in); diff --git a/slicer/tool/Jamfile.jam b/slicer/tool/Jamfile.jam index 2d22b55..a424301 100644 --- a/slicer/tool/Jamfile.jam +++ b/slicer/tool/Jamfile.jam @@ -1,8 +1,7 @@  import package ;  lib po : : <name>boost_program_options ; -lib boost_system ; -lib boost_filesystem ; +lib stdc++fs ;  lib mcpp ;  lib slicer-compiler : @@ -11,8 +10,7 @@ lib slicer-compiler :  	<library>slice//Slice  	<library>..//Ice++11  	<library>mcpp -	<library>boost_system -	<library>boost_filesystem +	<library>stdc++fs  	<library>..//adhocutil  	<library>../slicer//slicer  	<implicit-dependency>../slicer//slicer diff --git a/slicer/tool/parser.cpp b/slicer/tool/parser.cpp index 043d10c..c712589 100644 --- a/slicer/tool/parser.cpp +++ b/slicer/tool/parser.cpp @@ -8,11 +8,10 @@  #include <boost/algorithm/string/trim.hpp>  #include <boost/algorithm/string/split.hpp>  #include <Slice/CPlusPlusUtil.h> -#include <boost/filesystem/convenience.hpp>  #include <fprintbf.h>  #include <safeMapFind.h> -namespace fs = boost::filesystem; +namespace fs = std::filesystem;  namespace Slicer {  	Slicer::Slicer() : @@ -97,7 +96,7 @@ namespace Slicer {  		if (!cpp) return true;  		fprintbf(cpp, "// Begin Slicer code\n\n"); -		fprintbf(cpp, "#include <%s>\n\n", fs::change_extension(topLevelFile.filename(), ".h").string()); +		fprintbf(cpp, "#include <%s>\n\n", fs::path(topLevelFile.filename()).replace_extension(".h").string());  		fprintbf(cpp, "#include <%s>\n", (headerPrefix / "modelPartsTypes.impl.h").string());  		fprintbf(cpp, "#include <%s>\n", (headerPrefix / "common.h").string());  		for (const auto & m : u->modules()) { @@ -574,7 +573,7 @@ namespace Slicer {  			throw CompilerError("Both file handle and path provided.");  		}  		auto cppfile = std::unique_ptr<FILE, decltype(&fclose)>( -			cpp || cppPath.empty() ? cpp : fopen(cppPath.string(), "w"), +			cpp || cppPath.empty() ? cpp : fopen(cppPath.c_str(), "w"),  					cppPath.empty() ? fflush : fclose);  		if (!cppfile && !cppPath.empty()) {  			throw CompilerError("Failed to open output file"); diff --git a/slicer/tool/parser.h b/slicer/tool/parser.h index 5be5fbb..139cd32 100644 --- a/slicer/tool/parser.h +++ b/slicer/tool/parser.h @@ -2,7 +2,7 @@  #define SLICER_PARSER_H  #include <Slice/Parser.h> -#include <boost/filesystem/path.hpp> +#include <filesystem>  #include <visibility.h>  namespace Slicer { @@ -23,10 +23,10 @@ namespace Slicer {  			Slicer();  			FILE * cpp; -			boost::filesystem::path slicePath; -			boost::filesystem::path cppPath; -			boost::filesystem::path headerPrefix; -			std::vector<boost::filesystem::path> includes; +			std::filesystem::path slicePath; +			std::filesystem::path cppPath; +			std::filesystem::path headerPrefix; +			std::vector<std::filesystem::path> includes;  			unsigned int Execute();  			unsigned int Components() const; diff --git a/slicer/xml/Jamfile.jam b/slicer/xml/Jamfile.jam index 2886301..c841a87 100644 --- a/slicer/xml/Jamfile.jam +++ b/slicer/xml/Jamfile.jam @@ -1,8 +1,7 @@  import testing ;  import package ; -lib boost_system ; -lib boost_filesystem ; +lib stdc++fs ;  lib boost_utf : : <name>boost_unit_test_framework ;  lib slicer-xml : @@ -10,8 +9,7 @@ lib slicer-xml :  	[ glob *.ice ]  	:  	<include>.. -	<library>boost_system -	<library>boost_filesystem +	<library>stdc++fs  	<library>..//Ice  	<library>../..//libxmlpp  	<library>..//adhocutil @@ -25,6 +23,7 @@ run testSpecifics.cpp  	: : :  	<define>BOOST_TEST_DYN_LINK  	<library>slicer-xml +	<library>stdc++fs  	<implicit-dependency>slicer-xml  	<library>boost_utf  	<library>../test//types diff --git a/slicer/xml/serializer.cpp b/slicer/xml/serializer.cpp index b5719a1..bcc291a 100644 --- a/slicer/xml/serializer.cpp +++ b/slicer/xml/serializer.cpp @@ -403,12 +403,12 @@ namespace Slicer {  		doc.write_to_stream(strm);  	} -	XmlFileSerializer::XmlFileSerializer(const boost::filesystem::path & p) : +	XmlFileSerializer::XmlFileSerializer(const std::filesystem::path & p) :  		path(p)  	{  	} -	XmlFileDeserializer::XmlFileDeserializer(const boost::filesystem::path & p) : +	XmlFileDeserializer::XmlFileDeserializer(const std::filesystem::path & p) :  		path(p)  	{  	} diff --git a/slicer/xml/serializer.h b/slicer/xml/serializer.h index e3b40f0..561b08f 100644 --- a/slicer/xml/serializer.h +++ b/slicer/xml/serializer.h @@ -34,12 +34,12 @@ namespace Slicer {  	class DLL_PUBLIC XmlFileSerializer : public XmlSerializer {  		public: -			XmlFileSerializer(const boost::filesystem::path &); +			XmlFileSerializer(const std::filesystem::path &);  			virtual void Serialize(ModelPartForRootPtr) override;  		protected: -			const boost::filesystem::path path; +			const std::filesystem::path path;  	};  	class DLL_PUBLIC XmlDocumentSerializer : public XmlSerializer { @@ -73,12 +73,12 @@ namespace Slicer {  	class DLL_PUBLIC XmlFileDeserializer : public XmlDeserializer {  		public: -			XmlFileDeserializer(const boost::filesystem::path &); +			XmlFileDeserializer(const std::filesystem::path &);  			virtual void Deserialize(ModelPartForRootPtr) override;  		protected: -			const boost::filesystem::path path; +			const std::filesystem::path path;  	};  	class DLL_PUBLIC XmlDocumentDeserializer : public XmlDeserializer {  | 
