X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmover.h;h=1aae717766fb089249c36d50fbe0007dc7a10254;hb=35204f8f33d7400a5fefeffea533fb4cb4097211;hp=153a20ba89f8871407340f862913524c1758e7ea;hpb=e3671722567785da470c34d76a77ba0968e0cef9;p=lyx.git diff --git a/src/mover.h b/src/mover.h index 153a20ba89..1aae717766 100644 --- a/src/mover.h +++ b/src/mover.h @@ -15,6 +15,9 @@ #include #include + +namespace lyx { + /** * Utility to copy a file of a specified format from one place to another. * This base class simply invokes the command support::copy(). @@ -31,9 +34,10 @@ public: * \returns true if successful. */ bool - copy(std::string const & from, std::string const & to) const + copy(std::string const & from, std::string const & to, + unsigned long int mode = (unsigned long int)-1) const { - return do_copy(from, to, to); + return do_copy(from, to, to, mode); } /** Copy file @c from to @c to. @@ -46,9 +50,10 @@ public: */ bool copy(std::string const & from, std::string const & to, - std::string const & latex) const + 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. @@ -81,11 +86,11 @@ public: protected: virtual bool do_copy(std::string const & from, std::string const & to, - std::string const &) const; + std::string const &, unsigned long int mode) const; virtual bool do_rename(std::string const & from, std::string const & to, - std::string const &) const; + std::string const &) const; }; @@ -98,15 +103,16 @@ protected: * copied .fig file will require a transformation of the picture file * reference if it is to be found by XFig. */ -struct SpecialisedMover : public Mover +class SpecialisedMover : public Mover { +public: SpecialisedMover() {} /** @c command should be of the form * - * sh $$s/copy_fig.sh $$i $$o $$l + * python $$s/scripts/fig_copy.py $$i $$o $$l * - * where $$s is a placeholder for the lyx script directory, + * where $$s is a placeholder for the lyx support directory, * $$i is a placeholder for the name of the file to be moved, * $$o is a placeholder for the name of the file after moving, * $$l is a placeholder for the name of the file after moving, @@ -127,11 +133,11 @@ struct SpecialisedMover : public Mover private: virtual bool do_copy(std::string const & from, std::string const & to, - std::string const & latex) const; + std::string const & latex, unsigned long int mode) const; virtual bool do_rename(std::string const & from, std::string const & to, - std::string const & latex) const; + std::string const & latex) const; std::string command_; }; @@ -173,4 +179,7 @@ private: extern Movers movers; extern Movers system_movers; + +} // namespace lyx + #endif // MOVER_H