]> git.lyx.org Git - features.git/commitdiff
simplification
authorAndré Pönitz <poenitz@gmx.net>
Tue, 6 Nov 2007 22:20:05 +0000 (22:20 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Tue, 6 Nov 2007 22:20:05 +0000 (22:20 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21483 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferView.cpp
src/sgml.cpp
src/support/fs_extras.cpp
src/support/fs_extras.h

index 51f856fbfed766b8b6ccdeaf659730c765928b09..f01b460b1dd1049d7d75571c38e30375d9f743e7 100644 (file)
 #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;
@@ -97,8 +95,6 @@ using std::mem_fun_ref;
 using std::string;
 using std::vector;
 
-namespace fs = boost::filesystem;
-
 namespace lyx {
 
 using support::addPath;
@@ -2062,7 +2058,7 @@ docstring BufferView::contentsOfPlaintextFile(string const & f,
                        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 =
index 928e0eb09ee8fd1b621039fc1a65299f4d8d77b1..76e8ee0a4be049a508b72679bf068c20f1164047 100644 (file)
@@ -212,7 +212,7 @@ void sgml::openTag(Buffer const & buf, odocstream & os,
        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(">");
@@ -223,7 +223,7 @@ void sgml::openTag(Buffer const & buf, odocstream & os,
        } 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));
index de2f2725141f6eddcc65bf6755bad8e81a8eaf8f..0a3dfe008481926213c916f634255a442796c1f9 100644 (file)
@@ -46,50 +46,6 @@ namespace fs = boost::filesystem;
 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)
 {
 
index 82dc4de5f10dcea006169289d15113948269458a..cdb026735bbb03dc04b86f01772090a14f3fd5c0 100644 (file)
 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);
 
 }