#include "support/filetools.h"
#include "support/Package.h"
#include "support/types.h"
-#include "support/fs_extras.h"
-#include <boost/bind.hpp>
#include <boost/current_function.hpp>
-#include <boost/filesystem/operations.hpp>
#include <cerrno>
#include <fstream>
#include <functional>
+#include <iterator>
#include <vector>
using std::distance;
using std::string;
using std::vector;
-namespace fs = boost::filesystem;
-
namespace lyx {
using support::addPath;
return docstring();
}
- if (!fs::is_readable(fname.toFilesystemEncoding())) {
+ if (!fname.isReadable()) {
docstring const error = from_ascii(strerror(errno));
docstring const file = makeDisplayPath(fname.absFilename(), 50);
docstring const text =
string id = par.getID(buf, runparams);
string attribute;
- if(!id.empty()) {
+ if (!id.empty()) {
if (param.find('#') != string::npos) {
string::size_type pos = param.find("id=<");
string::size_type end = param.find(">");
} else {
if (param.find('#') != string::npos) {
// FIXME UNICODE
- if(!style->counter.empty())
+ if (!style->counter.empty())
counters.step(style->counter);
else
counters.step(from_ascii(name));
namespace boost {
namespace filesystem {
-bool is_readable(path const & ph)
-{
-#ifdef BOOST_POSIX
- return ::access(ph.string().c_str(), R_OK) == 0;
-#endif
-#ifdef BOOST_WINDOWS
- DWORD const attr = ::GetFileAttributes(ph.string().c_str());
- return attr != INVALID_FILE_ATTRIBUTES &&
- (attr & FILE_ATTRIBUTE_DIRECTORY) != FILE_ATTRIBUTE_DIRECTORY;
-#endif
-}
-
-
-bool is_writable(path const & ph)
-{
-#ifdef BOOST_POSIX
- return ::access(ph.string().c_str(), W_OK) == 0;
-#endif
-#ifdef BOOST_WINDOWS
- DWORD const attr = ::GetFileAttributes(ph.string().c_str());
- if (attr != INVALID_FILE_ATTRIBUTES &&
- (attr & FILE_ATTRIBUTE_READONLY) != 0) {
- // Read-only - no write access
- return false;
- }
- return attr != INVALID_FILE_ATTRIBUTES &&
- (attr & FILE_ATTRIBUTE_DIRECTORY) != FILE_ATTRIBUTE_DIRECTORY;
-#endif
-}
-
-
-bool is_readonly(path const & ph)
-{
-#ifdef BOOST_POSIX
- return is_readable(ph) && !is_writable(ph);
-#endif
-#ifdef BOOST_WINDOWS
- DWORD const attr = ::GetFileAttributes(ph.string().c_str());
- return (attr != INVALID_FILE_ATTRIBUTES
- && (attr & FILE_ATTRIBUTE_READONLY));
-#endif
-}
-
-
void copy_file(path const & source, path const & target, bool noclobber)
{
namespace boost {
namespace filesystem {
-bool is_readable(path const & ph);
-
-bool is_writable(path const & ph);
-
-bool is_readonly(path const & ph);
-
void copy_file(path const & source, path const & target, bool noclobber);
}