build: use experimental::fs over boost::fs

This commit is contained in:
Danny Robson 2016-10-07 19:48:42 +11:00
parent ea5c3befe4
commit 48364cd227
17 changed files with 37 additions and 37 deletions

View File

@ -101,7 +101,7 @@ NC_DEBUGGING
CHECK_RAGEL([ip.cpp])
NC_BOOST([1.53], [system filesystem thread])
NC_BOOST([1.53], [system thread])
AC_SUBST(BOOST_CPPFLAGS)
AC_SUBST(BOOST_LDFLAGS)

12
exe.cpp
View File

@ -31,7 +31,7 @@
#include <stdexcept>
#include <vector>
boost::filesystem::path
std::experimental::filesystem::path
util::image_path (void) {
static const char PROC_SELF[] = "/proc/self/exe";
@ -50,7 +50,7 @@ retry:
goto retry;
}
return boost::filesystem::path (resolved.data (), resolved.data () + written);
return std::experimental::filesystem::path (resolved.data (), resolved.data () + written);
}
#elif defined(PLATFORM_FREEBSD)
@ -61,7 +61,7 @@ retry:
#include <sys/types.h>
#include <sys/sysctl.h>
boost::filesystem::path
std::experimental::filesystem::path
util::image_path (void)
{
int name[] = {
@ -77,7 +77,7 @@ util::image_path (void)
auto err = sysctl (name, elems (name), data, &len, nullptr, 0);
errno_error::try_code (err);
return boost::filesystem::path (std::cbegin (data), std::cbegin (data) + len);
return std::experimental::filesystem::path (std::cbegin (data), std::cbegin (data) + len);
}
#elif defined(PLATFORM_WIN32)
@ -86,7 +86,7 @@ util::image_path (void)
#include <windows.h>
boost::filesystem::path
std::experimental::filesystem::path
util::image_path (void) {
std::vector<char> resolved (256);
@ -100,7 +100,7 @@ retry:
goto retry;
}
return boost::filesystem::path (resolved.data (), resolved.data () + written);
return std::experimental::filesystem::path (resolved.data (), resolved.data () + written);
}
#else

View File

@ -17,10 +17,10 @@
#ifndef __UTIL_EXE_HPP
#define __UTIL_EXE_HPP
#include <boost/filesystem/path.hpp>
#include <experimental/filesystem>
namespace util {
boost::filesystem::path image_path (void);
std::experimental::filesystem::path image_path (void);
}
#endif

4
io.cpp
View File

@ -27,7 +27,7 @@
#include <sys/types.h>
#include <unistd.h>
#include <boost/filesystem.hpp>
#include <experimental/filesystem>
#include <stdexcept>
@ -201,7 +201,7 @@ scoped_cwd::~scoped_cwd ()
///////////////////////////////////////////////////////////////////////////////
path_error::path_error (const boost::filesystem::path &_path):
path_error::path_error (const std::experimental::filesystem::path &_path):
runtime_error (format::render ("Unknown path: %!", m_path)),
m_path (_path)
{ ; }

6
io.hpp
View File

@ -27,7 +27,7 @@
#include <cstdio>
#include <cstdint>
#include <memory>
#include <boost/filesystem/path.hpp>
#include <experimental/filesystem>
#ifdef PLATFORM_WIN32
#include <windows.h>
@ -104,12 +104,12 @@ namespace util {
//-------------------------------------------------------------------------
class path_error : public std::runtime_error {
public:
path_error (const boost::filesystem::path &path);
path_error (const std::experimental::filesystem::path &path);
const char* path (void) const noexcept;
private:
const boost::filesystem::path m_path;
const std::experimental::filesystem::path m_path;
};
class stream_error : public std::exception {

View File

@ -118,7 +118,7 @@ mapped_file::mapped_file (::util::win32::handle &&src,
//-----------------------------------------------------------------------------
mapped_file::mapped_file (const boost::filesystem::path &path,
mapped_file::mapped_file (const std::experimental::filesystem::path &path,
int fflags,
int mflags):
mapped_file (

View File

@ -22,7 +22,7 @@
#include "./view.hpp"
#include <cstdint>
#include <boost/filesystem/path.hpp>
#include <experimental/filesystem>
#include <windows.h>
#include <sys/stat.h>
#include <sys/types.h>
@ -57,7 +57,7 @@ namespace util {
mapped_file (::util::win32::handle &&,
int fflags = O_RDONLY,
int mflags = PROT_READ);
mapped_file (const boost::filesystem::path &path,
mapped_file (const std::experimental::filesystem::path &path,
int fflags = O_RDONLY,
int mflags = PROT_READ);
mapped_file (const util::fd&,

View File

@ -17,7 +17,7 @@
#ifndef __UTIL_JSON_FLAT_HPP
#define __UTIL_JSON_FLAT_HPP
#include <boost/filesystem/path.hpp>
#include <experimental/filesystem>
#include <ostream>
#include "../view.hpp"

View File

@ -528,7 +528,7 @@ json::schema::validate (json::tree::node &data,
//-----------------------------------------------------------------------------
void
json::schema::validate (json::tree::node &data,
const boost::filesystem::path &schema_path)
const std::experimental::filesystem::path &schema_path)
{
const util::mapped_file schema_data (schema_path.string ().c_str ());
auto schema_object = json::tree::parse (schema_data.as_view<char> ());

View File

@ -20,7 +20,7 @@
#include "./fwd.hpp"
#include <memory>
#include <boost/filesystem/path.hpp>
#include <experimental/filesystem>
namespace json { namespace schema {
// Validate the json tree using the provide schema object or path.
@ -29,7 +29,7 @@ namespace json { namespace schema {
// of validation. If a value is not present but the schema specifies a
// default, it will be realised in the data object.
void validate (json::tree::node &data, const json::tree::object &schema);
void validate (json::tree::node &data, const boost::filesystem::path &schema);
void validate (json::tree::node &data, const std::experimental::filesystem::path &schema);
} }
#endif

View File

@ -248,7 +248,7 @@ MAP(
//-----------------------------------------------------------------------------
std::unique_ptr<json::tree::node>
json::tree::parse (const boost::filesystem::path &src)
json::tree::parse (const std::experimental::filesystem::path &src)
{
const util::mapped_file data (src.string ().c_str ());
return parse (data.as_view<char> ());

View File

@ -29,7 +29,7 @@
#include <string>
#include <vector>
#include <boost/filesystem/path.hpp>
#include <experimental/filesystem>
namespace json { namespace tree {
@ -48,7 +48,7 @@ namespace json { namespace tree {
parse (util::view<T> data);
std::unique_ptr<node>
parse (const boost::filesystem::path &);
parse (const std::experimental::filesystem::path &);
extern void write (const json::tree::node&, std::ostream&);

2
m4/nc

@ -1 +1 @@
Subproject commit 006f69779160a490786399b1af6a7d1e251cd15c
Subproject commit 597459d7e6dd9d8994740a863231eac49cc9bd56

View File

@ -18,14 +18,14 @@
#include "./string.hpp"
#include <boost/filesystem.hpp>
#include <experimental/filesystem>
#include <cstdlib>
#include <stdexcept>
using util::term::csi::graphics;
static const boost::filesystem::path DEFAULT_SEARCH_DIR = "/usr/share/terminfo";
static const std::experimental::filesystem::path DEFAULT_SEARCH_DIR = "/usr/share/terminfo";
constexpr char util::term::csi::code::CSI;
@ -37,14 +37,14 @@ const graphics graphics::RESET (0);
//
// throws an exception if not found
static
boost::filesystem::path
find_terminfo_path (const boost::filesystem::path &dir,
std::experimental::filesystem::path
find_terminfo_path (const std::experimental::filesystem::path &dir,
const std::string &key)
{
const char letter[2] = { key[0], '\0' };
auto candidate = dir / letter / key;
if (!boost::filesystem::is_directory (candidate))
if (!std::experimental::filesystem::is_directory (candidate))
throw std::runtime_error ("path not found");
return candidate;
@ -56,7 +56,7 @@ find_terminfo_path (const boost::filesystem::path &dir,
//
// throws an exception if not found
static
boost::filesystem::path
std::experimental::filesystem::path
find_terminfo_path (const std::string &key)
{
// check if the path is explicitly listed. must not fall through.
@ -66,7 +66,7 @@ find_terminfo_path (const std::string &key)
// check if we have a path at $HOME. falls through.
if (const char *home = getenv ("HOME")) {
boost::filesystem::path HOME (home);
std::experimental::filesystem::path HOME (home);
try {
return find_terminfo_path (HOME / ".terminfo", key);
} catch (...) { }
@ -81,7 +81,7 @@ find_terminfo_path (const std::string &key)
return find_terminfo_path (
i.empty () ?
DEFAULT_SEARCH_DIR :
boost::filesystem::path (i.cbegin (), i.cend ()), key
std::experimental::filesystem::path (i.cbegin (), i.cend ()), key
);
} catch (...) { }
}

View File

@ -21,7 +21,7 @@
#include <cstdlib>
#include <iostream>
#include <boost/filesystem/path.hpp>
#include <experimental/filesystem>
///////////////////////////////////////////////////////////////////////////////

View File

@ -22,11 +22,11 @@
#include "io.hpp"
#include <boost/filesystem.hpp>
#include <experimental/filesystem>
#include <iostream>
namespace fs = boost::filesystem;
namespace fs = std::experimental::filesystem;
///////////////////////////////////////////////////////////////////////////////

View File

@ -21,7 +21,7 @@
#include <iostream>
#include <cstdlib>
#include <boost/filesystem.hpp>
#include <experimental/filesystem>
enum {