]> git.lyx.org Git - lyx.git/blobdiff - src/EmbeddedFiles.h
Improve these.
[lyx.git] / src / EmbeddedFiles.h
index eae7b0d64addc12f948625e17334f29967b99539..cca8e5e8e8d762155f1f7744b6d6506496761eeb 100644 (file)
@@ -150,7 +150,7 @@ public:
         * when an embedded file is copied to another buffer, temp_path_ has
         * to be updated and file copying may be needed.
         */
-       bool enabled() const { return temp_path_ != ""; }
+       bool enabled() const { return !temp_path_.empty(); }
        /// enable embedding of this file
        void enable(bool flag, Buffer const * buf, bool updateFile);
 
@@ -158,6 +158,8 @@ public:
        bool extract() const;
        /// update embedded file from external file, does not change embedding status
        bool updateFromExternalFile() const;
+       /// copy an embedded file to another buffer
+       EmbeddedFile copyTo(Buffer const * buf);
        ///
        /// After the embedding status is changed, update all insets related
        /// to this file item. For example, a graphic inset may need to monitor
@@ -205,14 +207,16 @@ public:
        /* \param file Embedded file to add
         * \param inset Inset pointer
         */
-       void registerFile(EmbeddedFile const & file, Inset const * inset, Buffer const & buffer);
-
+       void registerFile(EmbeddedFile const & file, Inset const * inset,
+               Buffer const & buffer);
+       /// returns a pointer to the Embedded file representing this object,
+       /// or null if not found. The filename should be absolute.
+       const_iterator findFile(std::string const & filename) const;
+       iterator findFile(std::string const & filename);
        /// validate embedded fies after a file is read.
        void validate(Buffer const & buffer);
-
        /// scan the buffer and get a list of EmbeddedFile
        void update(Buffer const & buffer);
-
        /// write a zip file
        bool writeFile(support::DocFileName const & filename, Buffer const & buffer);
 };