Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions cMake/FreeCAD_Helpers/SetupBoost.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ macro(SetupBoost)
# -------------------------------- Boost --------------------------------

set(_boost_TEST_VERSIONS ${Boost_ADDITIONAL_VERSIONS})

set (BOOST_COMPONENTS filesystem program_options regex thread date_time)
set (BOOST_COMPONENTS program_options regex thread date_time)
# set (BOOST_COMPONENTS filesystem program_options regex system thread date_time)
find_package(Boost ${BOOST_MIN_VERSION}
COMPONENTS ${BOOST_COMPONENTS} REQUIRED)
Expand Down
21 changes: 11 additions & 10 deletions src/3rdParty/salomesmesh/src/DriverSTL/SMESH_File.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@
#include <sys/mman.h>
#endif

#include <boost/filesystem.hpp>
#include <system_error>
#include <filesystem>

namespace boofs = boost::filesystem;
namespace stdfs = std::filesystem;

//================================================================================
/*!
Expand Down Expand Up @@ -168,8 +169,8 @@ bool SMESH_File::remove()
{
close();

boost::system::error_code err;
boofs::remove( _name, err );
std::error_code err;
stdfs::remove( _name, err );
_error = err.message();

return !err;
Expand All @@ -185,8 +186,8 @@ long SMESH_File::size()
{
if ( _size >= 0 ) return _size; // size of an open file

boost::system::error_code err;
boost::uintmax_t size = boofs::file_size( _name, err );
std::error_code err;
std::uintmax_t size = stdfs::file_size( _name, err );
_error = err.message();

return err ? -1 : (long) size;
Expand All @@ -200,8 +201,8 @@ long SMESH_File::size()

bool SMESH_File::exists()
{
boost::system::error_code err;
bool res = boofs::exists( _name, err );
std::error_code err;
bool res = stdfs::exists( _name, err );
_error = err.message();

return err ? false : res;
Expand All @@ -215,8 +216,8 @@ bool SMESH_File::exists()

bool SMESH_File::isDirectory()
{
boost::system::error_code err;
bool res = boofs::is_directory( _name, err );
std::error_code err;
bool res = stdfs::is_directory( _name, err );
_error = err.message();

return err ? false : res;
Expand Down
4 changes: 2 additions & 2 deletions src/3rdParty/salomesmesh/src/SMESH/DriverGMF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

#include "DriverGMF.hxx"

#include <boost/filesystem.hpp>
#include <filesystem>

extern "C"
{
Expand Down Expand Up @@ -55,7 +55,7 @@ namespace DriverGMF

bool isExtensionCorrect( const std::string& fileName )
{
std::string ext = boost::filesystem::path(fileName).extension().string();
std::string ext = std::filesystem::path(fileName).extension().string();
switch ( ext.size() ) {
case 5: return ( ext == ".mesh" || ext == ".solb" );
case 6: return ( ext == ".meshb" );
Expand Down
20 changes: 10 additions & 10 deletions src/App/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3071,15 +3071,15 @@ QString findUserHomePath(const QString& userHome)
* Returns the path where to store application files to.
* If \a customHome is not empty it will be used, otherwise a path starting from \a stdHome will be used.
*/
boost::filesystem::path findPath(const QString& stdHome, const QString& customHome,
std::filesystem::path findPath(const QString& stdHome, const QString& customHome,
const std::vector<std::string>& paths, bool create)
{
QString dataPath = customHome;
if (dataPath.isEmpty()) {
dataPath = stdHome;
}

boost::filesystem::path appData(Base::FileInfo::stringToPath(dataPath.toStdString()));
std::filesystem::path appData(Base::FileInfo::stringToPath(dataPath.toStdString()));

// If a custom user home path is given then don't modify it
if (customHome.isEmpty()) {
Expand All @@ -3088,10 +3088,10 @@ boost::filesystem::path findPath(const QString& stdHome, const QString& customHo
}

// In order to write to our data path, we must create some directories, first.
if (create && !boost::filesystem::exists(appData) && !Py_IsInitialized()) {
if (create && !std::filesystem::exists(appData) && !Py_IsInitialized()) {
try {
boost::filesystem::create_directories(appData);
} catch (const boost::filesystem::filesystem_error& e) {
std::filesystem::create_directories(appData);
} catch (const std::filesystem::filesystem_error& e) {
throw Base::FileSystemError("Could not create directories. Failed with: " + e.code().message());
}
}
Expand Down Expand Up @@ -3223,36 +3223,36 @@ void Application::ExtractUserPath()

// User data path
//
boost::filesystem::path data = findPath(dataHome, customData, subdirs, true);
std::filesystem::path data = findPath(dataHome, customHome, subdirs, true);
mConfig["UserAppData"] = Base::FileInfo::pathToString(data) + PATHSEP;


// User config path
//
boost::filesystem::path config = findPath(configHome, customHome, subdirs, true);
std::filesystem::path config = findPath(configHome, customHome, subdirs, true);
mConfig["UserConfigPath"] = Base::FileInfo::pathToString(config) + PATHSEP;


// User cache path
//
std::vector<std::string> cachedirs = subdirs;
cachedirs.emplace_back("Cache");
boost::filesystem::path cache = findPath(cacheHome, customTemp, cachedirs, true);
std::filesystem::path cache = findPath(cacheHome, customTemp, cachedirs, true);
mConfig["UserCachePath"] = Base::FileInfo::pathToString(cache) + PATHSEP;


// Set application tmp. directory
//
std::vector<std::string> empty;
boost::filesystem::path tmp = findPath(tempPath, customTemp, empty, true);
std::filesystem::path tmp = findPath(tempPath, customTemp, empty, true);
mConfig["AppTempPath"] = Base::FileInfo::pathToString(tmp) + PATHSEP;


// Set the default macro directory
//
std::vector<std::string> macrodirs = subdirs;
macrodirs.emplace_back("Macro");
boost::filesystem::path macro = findPath(dataHome, customData, macrodirs, true);
std::filesystem::path macro = findPath(dataHome, customData, macrodirs, true);
mConfig["UserMacroPath"] = Base::FileInfo::pathToString(macro) + PATHSEP;
}

Expand Down
4 changes: 2 additions & 2 deletions src/App/Document.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ recompute path. Also, it enables more complicated dependencies beyond trees.
#ifndef _PreComp_
# include <bitset>
# include <stack>
# include <boost/filesystem.hpp>
# include <filesystem>
#endif

#include <boost/algorithm/string.hpp>
Expand Down Expand Up @@ -127,7 +127,7 @@ using namespace zipios;
# define FC_LOGFEATUREUPDATE
#endif

namespace fs = boost::filesystem;
namespace fs = std::filesystem;

namespace App {

Expand Down
2 changes: 1 addition & 1 deletion src/App/ElementMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>

#include <boost/io/ios_state.hpp>

FC_LOG_LEVEL_INIT("ElementMap", true, 2);// NOLINT

Expand Down
1 change: 1 addition & 0 deletions src/App/Expression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#endif

#include <boost/algorithm/string/predicate.hpp>
#include <boost/io/ios_state.hpp>
#include <boost/math/special_functions/round.hpp>
#include <boost/math/special_functions/trunc.hpp>

Expand Down
8 changes: 4 additions & 4 deletions src/App/Metadata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ directly. If you did not intend to use a system-defined macro
#endif

using namespace App;
namespace fs = boost::filesystem;
namespace fs = std::filesystem;
#ifndef XERCES_CPP_NAMESPACE_BEGIN
#define XERCES_CPP_NAMESPACE_QUALIFIER
using namespace XERCES_CPP_NAMESPACE;
Expand Down Expand Up @@ -242,7 +242,7 @@ std::string Metadata::classname() const
return _classname;
}

boost::filesystem::path Metadata::subdirectory() const
std::filesystem::path Metadata::subdirectory() const
{
return _subdirectory;
}
Expand Down Expand Up @@ -361,7 +361,7 @@ void Metadata::setClassname(const std::string& name)
_classname = name;
}

void Metadata::setSubdirectory(const boost::filesystem::path& path)
void Metadata::setSubdirectory(const std::filesystem::path& path)
{
_subdirectory = path;
}
Expand Down Expand Up @@ -466,7 +466,7 @@ void Metadata::removeTag(const std::string& tag)
_tag.erase(new_end, _tag.end());
}

void Metadata::removeFile(const boost::filesystem::path& path)
void Metadata::removeFile(const std::filesystem::path& path)
{
auto new_end = std::remove(_file.begin(), _file.end(), path);
_file.erase(new_end, _file.end());
Expand Down
30 changes: 15 additions & 15 deletions src/App/Metadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

#include "FCConfig.h"

#include <boost/filesystem.hpp>
#include <filesystem>

#include <map>
#include <memory>
Expand Down Expand Up @@ -64,10 +64,10 @@ struct AppExport Contact {
*/
struct AppExport License {
License() = default;
License(std::string name, boost::filesystem::path file);
License(std::string name, std::filesystem::path file);
explicit License(const XERCES_CPP_NAMESPACE::DOMElement* elem);
std::string name;//< Short name of license, e.g. "LGPL2", "MIT", "Mozilla Public License", etc.
boost::filesystem::path
std::filesystem::path
file;//< Optional path to the license file, relative to the XML file's location
bool operator==(const License& rhs) const;
};
Expand Down Expand Up @@ -196,7 +196,7 @@ class AppExport Metadata
* This constructor takes a path to an XML file and loads the XML from that file as
* metadata.
*/
explicit Metadata(const boost::filesystem::path& metadataFile);
explicit Metadata(const std::filesystem::path& metadataFile);

/**
* Construct a Metadata object from a DOM node.
Expand Down Expand Up @@ -238,12 +238,12 @@ class AppExport Metadata
std::vector<Meta::Dependency>
replace() const;//< Zero or more packages this package is intended to replace.
std::vector<std::string> tag() const;//< Zero or more text tags related to this package.
boost::filesystem::path icon() const;//< Path to an icon file.
std::filesystem::path icon() const;//< Path to an icon file.
std::string
classname() const;//< Recognized for convenience -- generally only used by Workbenches.
boost::filesystem::path
std::filesystem::path
subdirectory() const;//< Optional, override the default subdirectory name for this item.
std::vector<boost::filesystem::path>
std::vector<std::filesystem::path>
file() const;//< Arbitrary files associated with this package or content item.
Meta::Version freecadmin() const;//< The minimum FreeCAD version.
Meta::Version freecadmax() const;//< The maximum FreeCAD version.
Expand Down Expand Up @@ -296,10 +296,10 @@ class AppExport Metadata
void addConflict(const Meta::Dependency& dep);
void addReplace(const Meta::Dependency& dep);
void addTag(const std::string& tag);
void setIcon(const boost::filesystem::path& path);
void setIcon(const std::filesystem::path& path);
void setClassname(const std::string& name);
void setSubdirectory(const boost::filesystem::path& path);
void addFile(const boost::filesystem::path& path);
void setSubdirectory(const std::filesystem::path& path);
void addFile(const std::filesystem::path& path);
void addContentItem(const std::string& tag, const Metadata& item);
void setFreeCADMin(const Meta::Version& version);
void setFreeCADMax(const Meta::Version& version);
Expand All @@ -316,7 +316,7 @@ class AppExport Metadata
void removeConflict(const Meta::Dependency& dep);
void removeReplace(const Meta::Dependency& dep);
void removeTag(const std::string& tag);
void removeFile(const boost::filesystem::path& path);
void removeFile(const std::filesystem::path& path);

// Utility functions to clear lists
void clearContent();
Expand All @@ -333,7 +333,7 @@ class AppExport Metadata
/**
* Write the metadata to an XML file
*/
void write(const boost::filesystem::path& file) const;
void write(const std::filesystem::path& file) const;

/**
* Determine whether this package satisfies the given dependency
Expand All @@ -359,10 +359,10 @@ class AppExport Metadata
std::vector<Meta::Dependency> _conflict;
std::vector<Meta::Dependency> _replace;
std::vector<std::string> _tag;
boost::filesystem::path _icon;
std::filesystem::path _icon;
std::string _classname;
boost::filesystem::path _subdirectory;
std::vector<boost::filesystem::path> _file;
std::filesystem::path _subdirectory;
std::vector<std::filesystem::path> _file;
Meta::Version _freecadmin;
Meta::Version _freecadmax;
Meta::Version _pythonmin;
Expand Down
12 changes: 6 additions & 6 deletions src/App/PropertyStandard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ PropertyPath::~PropertyPath() = default;
//**************************************************************************
// Setter/getter for the property

void PropertyPath::setValue(const boost::filesystem::path &Path)
void PropertyPath::setValue(const std::filesystem::path &Path)
{
aboutToSetValue();
_cValue = Path;
Expand All @@ -183,16 +183,16 @@ void PropertyPath::setValue(const char * Path)
{
aboutToSetValue();
#if (BOOST_FILESYSTEM_VERSION == 2)
_cValue = boost::filesystem::path(Path,boost::filesystem::no_check );
//_cValue = boost::filesystem::path(Path,boost::filesystem::native );
//_cValue = boost::filesystem::path(Path,boost::filesystem::windows_name );
_cValue = std::filesystem::path(Path,std::filesystem::no_check );
//_cValue = std::filesystem::path(Path,std::filesystem::native );
//_cValue = std::filesystem::path(Path,std::filesystem::windows_name );
#else
_cValue = boost::filesystem::path(Path);
_cValue = std::filesystem::path(Path);
#endif
hasSetValue();
}

const boost::filesystem::path &PropertyPath::getValue() const
const std::filesystem::path &PropertyPath::getValue() const
{
return _cValue;
}
Expand Down
8 changes: 4 additions & 4 deletions src/App/PropertyStandard.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include <string>
#include <vector>
#include <boost/dynamic_bitset.hpp>
#include <boost/filesystem/path.hpp>
// #include <boost/filesystem/path.hpp>
#include <Base/Uuid.h>

#include "Property.h"
Expand Down Expand Up @@ -104,15 +104,15 @@ class AppExport PropertyPath: public Property

/** Sets the property
*/
void setValue(const boost::filesystem::path &);
void setValue(const std::filesystem::path &);

/** Sets the property
*/
void setValue(const char *);

/** This method returns a string representation of the property
*/
const boost::filesystem::path &getValue() const;
const std::filesystem::path &getValue() const;

const char* getEditorName() const override { return "Gui::PropertyEditor::PropertyPathItem"; }

Expand All @@ -135,7 +135,7 @@ class AppExport PropertyPath: public Property
}

protected:
boost::filesystem::path _cValue;
std::filesystem::path _cValue;
};

/// Property wrapper around an Enumeration object.
Expand Down
2 changes: 1 addition & 1 deletion src/App/StringHasher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
#include <boost/bimap.hpp>
#include <boost/bimap/set_of.hpp>
#include <boost/bimap/unordered_set_of.hpp>
#include <boost/io/ios_state.hpp>
#include <boost/iostreams/stream.hpp>

#include "MappedElement.h"
#include "StringHasher.h"
#include "StringHasherPy.h"
Expand Down
Loading
Loading