X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmover.h;h=1e4666ec5329ae9abcbe1b38c92c963967490031;hb=67ae65f43093cc738e41607c8a5011854d47cbf9;hp=a2af0f723a2c9903fe316f40713a3f5330cd3128;hpb=debd34424fdc6b2d610b5c03735b188c2a85940a;p=lyx.git diff --git a/src/mover.h b/src/mover.h index a2af0f723a..1e4666ec53 100644 --- a/src/mover.h +++ b/src/mover.h @@ -15,6 +15,11 @@ #include #include + +namespace lyx { + +namespace support { class FileName; } + /** * Utility to copy a file of a specified format from one place to another. * This base class simply invokes the command support::copy(). @@ -31,10 +36,8 @@ public: * \returns true if successful. */ bool - copy(std::string const & from, std::string const & to) const - { - return do_copy(from, to, to); - } + copy(support::FileName const & from, support::FileName const & to, + unsigned long int mode = (unsigned long int)-1) const; /** Copy file @c from to @c to. * \see SpecialisedMover::SpecialisedMover() for an explanation of @@ -45,10 +48,11 @@ public: * \returns true if successful. */ bool - copy(std::string const & from, std::string const & to, - std::string const & latex) const + copy(support::FileName const & from, support::FileName const & to, + std::string const & latex, + unsigned long int mode = (unsigned long int)-1) const { - return do_copy(from, to, latex); + return do_copy(from, to, latex, mode); } /** Rename file @c from as @c to. @@ -58,10 +62,7 @@ public: * \returns true if successful. */ bool - rename(std::string const & from, std::string const & to) const - { - return do_rename(from, to, to); - } + rename(support::FileName const & from, support::FileName const & to) const; /** Rename file @c from as @c to. * \see SpecialisedMover::SpecialisedMover() for an explanation of @@ -72,7 +73,7 @@ public: * \returns true if successful. */ bool - rename(std::string const & from, std::string const & to, + rename(support::FileName const & from, support::FileName const & to, std::string const & latex) const { return do_rename(from, to, latex); @@ -80,11 +81,11 @@ public: protected: virtual bool - do_copy(std::string const & from, std::string const & to, - std::string const &) const; + do_copy(support::FileName const & from, support::FileName const & to, + std::string const &, unsigned long int mode) const; virtual bool - do_rename(std::string const & from, std::string const & to, + do_rename(support::FileName const & from, support::FileName const & to, std::string const &) const; }; @@ -127,11 +128,11 @@ public: private: virtual bool - do_copy(std::string const & from, std::string const & to, - std::string const & latex) const; + do_copy(support::FileName const & from, support::FileName const & to, + std::string const & latex, unsigned long int mode) const; virtual bool - do_rename(std::string const & from, std::string const & to, + do_rename(support::FileName const & from, support::FileName const & to, std::string const & latex) const; std::string command_; @@ -174,4 +175,7 @@ private: extern Movers movers; extern Movers system_movers; + +} // namespace lyx + #endif // MOVER_H