25 #ifndef _FILESYSTEM_HPP_ 26 #define _FILESYSTEM_HPP_ 31 #include <boost/filesystem/operations.hpp> 32 #include <boost/filesystem/convenience.hpp> 33 #include <boost/filesystem/fstream.hpp> 34 #include <boost/version.hpp> 37 namespace bfs = boost::filesystem;
39 #ifndef BOOST_FILESYSTEM_VERSION 40 # if (BOOST_VERSION/100) >= 1046 41 # define BOOST_FILESYSTEM_VERSION 3 43 # define BOOST_FILESYSTEM_VERSION 2 45 #endif // BOOST_FILESYSTEM_VERSION 51 #if BOOST_FILESYSTEM_VERSION == 2 53 #define BFS_STRING(p) p 54 #define BFS_GENERIC_STRING(p) p 56 #define BFS_COMPLETE bfs::complete 59 #define BFS_STRING(p) (p).string() 60 #define BFS_GENERIC_STRING(p) (p).generic_string() 62 #define BFS_COMPLETE bfs::system_complete 74 vector<bfs::path>& matchingPaths);
80 PWIZ_API_DECL void copy_directory(
const bfs::path& from,
const bfs::path& to,
bool recursive =
true, boost::system::error_code* ec = 0);
113 #endif // _FILESYSTEM_HPP_
PWIZ_API_DECL int expand_pathmask(const bfs::path &pathmask, vector< bfs::path > &matchingPaths)
expands (aka globs) a pathmask to zero or more matching paths and returns the number of matching path...
sizes are treated as multiples of 2; abbreviations are: GiB (Gibibyte), MiB (Mebibyte), KiB (Kibibyte), B (byte)
PWIZ_API_DECL void copy_directory(const bfs::path &from, const bfs::path &to, bool recursive=true, boost::system::error_code *ec=0)
if recursive is true, then copies "from" and all its contents to "to"; if "to" already exists or the ...
PWIZ_API_DECL std::string read_file_header(const std::string &filepath, size_t length=512)
sizes are treated as multiples of 10; abbreviations are: GB (Gigabyte), MB (Megabyte), KB (Kilobyte), B (byte)
PWIZ_API_DECL std::pair< int, int > get_console_bounds(const std::pair< int, int > &defaultBounds=std::pair< int, int >(80, 24))
attempts to get the platform-specific console bounds (number of columns and lines), returns defaultBounds if an error occurs or the platform is not supported
PWIZ_API_DECL std::string abbreviate_byte_size(boost::uintmax_t byteSize, ByteSizeAbbreviation abbreviationType=ByteSizeAbbreviation_SI)
abbreviates a byte size (file or RAM) as a readable string, using the specified notation ...
sizes are treated as multiples of 2; abbreviations are: GB (Gigabyte), MB (Megabyte), KB (Kilobyte), B (byte)