X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fformat.h;h=07feb88d6c19ab48921c9347c5930c01090babcd;hb=5e3b997b852fc96eef2387934b600262d3037745;hp=3751b6d0af2111d127d4ce4e46d860860809681e;hpb=da61af2b8ef95ab206d02deb9c52f03335682d9e;p=lyx.git diff --git a/src/format.h b/src/format.h index 3751b6d0af..07feb88d6c 100644 --- a/src/format.h +++ b/src/format.h @@ -84,16 +84,23 @@ public: Format const & get(FormatList::size_type i) const { return formatlist[i]; } - /// + /// \returns format named \p name if it exists, otherwise 0 Format const * getFormat(std::string const & name) const; + /*! + * Get the format of \p filename from file contents or, if this + * fails, from file extension. + * \returns file format if it could be found, otherwise an empty + * string. + */ + std::string getFormatFromFile(std::string const & filename) const; /// int getNumber(std::string const & name) const; /// void add(std::string const & name); /// void add(std::string const & name, std::string const & extension, - std::string const & prettyname, std::string const & shortcut, - std::string const & viewer, std::string const & editor); + std::string const & prettyname, std::string const & shortcut, + std::string const & viewer, std::string const & editor); /// void erase(std::string const & name); ///