Переглянути джерело

Update to Boost.Filesystem version 3, since Boost 1.50 drops support for version 2.
Check http://forum.vcmi.eu/viewtopic.php?t=518

Michał W. Urbańczyk 13 роки тому
батько
коміт
54ca71d598
5 змінених файлів з 7 додано та 7 видалено
  1. 2 2
      Global.h
  2. 1 1
      client/CPlayerInterface.cpp
  3. 1 1
      lib/CCampaignHandler.cpp
  4. 1 1
      lib/CFileUtility.cpp
  5. 2 2
      lib/CLodHandler.cpp

+ 2 - 2
Global.h

@@ -49,8 +49,8 @@
 #include <memory>
 #include <cstdlib>
 
-//filesystem version 3 causes problems (and it's default as of boost 1.46)
-#define BOOST_FILESYSTEM_VERSION 2
+//The only available version is 3, as of Boost 1.50
+#define BOOST_FILESYSTEM_VERSION 3
 
 #include <boost/algorithm/string.hpp>
 #include <boost/assert.hpp>

+ 1 - 1
client/CPlayerInterface.cpp

@@ -1553,7 +1553,7 @@ int CPlayerInterface::getLastIndex( std::string namePrefix)
 	{
 		if(is_regular(dir->status()))
 		{
-			std::string name = dir->path().leaf();
+			std::string name = dir->path().leaf().string();
 			if(starts_with(name, namePrefix) && ends_with(name, ".vlgm1"))
 			{
 				char nr = name[namePrefix.size()];

+ 1 - 1
lib/CCampaignHandler.cpp

@@ -42,7 +42,7 @@ std::vector<CCampaignHeader> CCampaignHandler::getCampaignHeaders(GetMode mode)
 		for ( fs::directory_iterator file (tie); file!=end_iter; ++file )
 		{
 			if(fs::is_regular_file(file->status())
-				&& boost::ends_with(file->path().filename(), ext))
+				&& boost::ends_with(file->path().filename().string(), ext))
 			{
 				ret.push_back( getHeader( file->path().string(), false ) );
 			}

+ 1 - 1
lib/CFileUtility.cpp

@@ -34,7 +34,7 @@ void CFileUtility::getFilesWithExt(std::vector<FileInfo> &out, const std::string
 	for ( fs::directory_iterator file (tie); file!=end_iter; ++file )
 	{
 		if(fs::is_regular_file(file->status())
-			&& boost::ends_with(file->path().filename(), ext))
+			&& boost::ends_with(file->path().filename().string(), ext))
 		{
 			std::time_t date = 0;
 			try

+ 2 - 2
lib/CLodHandler.cpp

@@ -285,7 +285,7 @@ void CLodHandler::init(const std::string lodFile, const std::string dirName)
 			if (boost::filesystem::is_directory(dir->status()))
 			{
 				path.resize(dir.level()+1);
-				path.back() = dir->path().leaf();
+				path.back() = dir->path().leaf().string();
 			}
 			if(boost::filesystem::is_regular(dir->status()))
 			{
@@ -295,7 +295,7 @@ void CLodHandler::init(const std::string lodFile, const std::string dirName)
 				for (size_t i=0; i<dir.level() && i<path.size(); i++)
 					e.realName += path[i] + '/';
 
-				e.realName += dir->path().leaf();
+				e.realName += dir->path().leaf().string();
 
 				initEntry(e, e.realName);