X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FConverter.h;h=fe95be6ed8948e099df16fac6990c4037e7df432;hb=780d9a5f4cc553797ec95e49300cf06325ff1341;hp=e144ca2fa46459764d6492e83b0b9ff1ec029c8e;hpb=33bfbf89c4267ed8e37fad1681adce4cd5dfddf4;p=lyx.git diff --git a/src/Converter.h b/src/Converter.h index e144ca2fa4..fe95be6ed8 100644 --- a/src/Converter.h +++ b/src/Converter.h @@ -30,9 +30,17 @@ class ErrorList; class Format; class Formats; -typedef std::vector FormatList; +class ConversionException : public std::exception { +public: + ConversionException() {} + virtual ~ConversionException() throw() {} + virtual const char * what() const throw() + { return "Exception caught in conversion routine!"; } +}; +typedef std::vector FormatList; + /// class Converter { public: @@ -66,7 +74,7 @@ public: /// std::string const latex_flavor() const { return latex_flavor_; } /// - bool xml() const { return xml_; } + bool docbook() const { return docbook_; } /// bool need_aux() const { return need_aux_; } /// Return whether or not the needauth option is set for this converter @@ -100,8 +108,8 @@ private: bool latex_; /// The latex derivate trivstring latex_flavor_; - /// The converter is xml - bool xml_; + /// The converter is DocBook + bool docbook_; /// This converter needs the .aux files bool need_aux_; /// we need a "nice" file from the backend, c.f. OutputParams.nice. @@ -128,7 +136,13 @@ public: typedef std::vector ConverterList; /// typedef ConverterList::const_iterator const_iterator; - + /// Return values for converter runs + enum RetVal { + SUCCESS = 0, + FAILURE = 1, + KILLED = 1000 + }; + /// Converter const & get(int i) const { return converterlist_[i]; } /// @@ -162,7 +176,7 @@ public: Graph::EdgePath getPath(std::string const & from, std::string const & to); /// OutputParams::FLAVOR getFlavor(Graph::EdgePath const & path, - Buffer const * buffer = 0); + Buffer const * buffer = nullptr); /// std::string getHyperrefDriver(Graph::EdgePath const & path); /// Flags for converting files @@ -175,11 +189,11 @@ public: try_cache = 1 << 1 }; /// - bool convert(Buffer const * buffer, + RetVal convert(Buffer const * buffer, support::FileName const & from_file, support::FileName const & to_file, support::FileName const & orig_from, std::string const & from_format, std::string const & to_format, - ErrorList & errorList, int conversionflags = none); + ErrorList & errorList, int conversionflags = none, bool includeall = false); /// void update(Formats const & formats); /// @@ -216,7 +230,7 @@ private: bool scanLog(Buffer const & buffer, std::string const & command, support::FileName const & filename, ErrorList & errorList); /// - bool runLaTeX(Buffer const & buffer, std::string const & command, + RetVal runLaTeX(Buffer const & buffer, std::string const & command, OutputParams const &, ErrorList & errorList); /// ConverterList converterlist_;