mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-06-09 22:02:10 +02:00
Replace most uses of Boost.{Filesystem,Process}
With the `ghc::filesystem` dependency from the previous commit. If we can replace the rest of the Boost.Filesystem dependency then we can get rid the one nasty runtime dependency we have, and it will make implementing the chainloading simpler since can reuse more code without bringing in Boost.
This commit is contained in:
@@ -16,10 +16,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef __WINE__
|
||||
#include "../wine-host/boost-fix.h"
|
||||
#endif
|
||||
#include <boost/filesystem.hpp>
|
||||
#include <ghc/filesystem.hpp>
|
||||
|
||||
#include <bitsery/details/serialization_common.h>
|
||||
#include <bitsery/traits/core/traits.h>
|
||||
@@ -31,17 +28,17 @@ namespace ext {
|
||||
* An adapter for serializing and deserializing filesystem paths since they're
|
||||
* not mutable.
|
||||
*/
|
||||
class BoostPath {
|
||||
class GhcPath {
|
||||
public:
|
||||
template <typename Ser, typename Fnc>
|
||||
void serialize(Ser& ser, const boost::filesystem::path& path, Fnc&&) const {
|
||||
void serialize(Ser& ser, const ghc::filesystem::path& path, Fnc&&) const {
|
||||
auto path_str = path.string();
|
||||
ser.text1b(path_str, 4096);
|
||||
}
|
||||
|
||||
template <typename Des, typename Fnc>
|
||||
void deserialize(Des& des, boost::filesystem::path& path, Fnc&&) const {
|
||||
boost::filesystem::path::string_type path_str{};
|
||||
void deserialize(Des& des, ghc::filesystem::path& path, Fnc&&) const {
|
||||
ghc::filesystem::path::string_type path_str{};
|
||||
des.text1b(path_str, 4096);
|
||||
path = path_str;
|
||||
}
|
||||
@@ -52,7 +49,7 @@ class BoostPath {
|
||||
namespace traits {
|
||||
|
||||
template <>
|
||||
struct ExtensionTraits<ext::BoostPath, boost::filesystem::path> {
|
||||
struct ExtensionTraits<ext::GhcPath, ghc::filesystem::path> {
|
||||
using TValue = void;
|
||||
static constexpr bool SupportValueOverload = false;
|
||||
static constexpr bool SupportObjectOverload = true;
|
||||
Reference in New Issue
Block a user