- ///
- Format const * getFormat(string const & name) const;
- ///
- int getNumber(string const & name) const;
- ///
- void add(string const & name);
- ///
- void add(string const & name, string const & extension,
- string const & prettyname, string const & shortcut);
- ///
- void erase(string const & name);
+ /// \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(support::FileName const & filename) const;
+ /// Set editor and/or viewer to "auto" for formats that can be
+ /// opened by the OS.
+ void setAutoOpen();
+ ///
+ 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,
+ int flags);
+ ///
+ void erase(std::string const & name);