+ string const & s, string const & v) :
+ name_(n), extension_(e), prettyname_(p), shortcut_(s),
+ viewer_(v) {};
+ ///
+ bool dummy() const;
+ ///
+ bool IsChildFormat() const;
+ ///
+ string const ParentFormat() const;
+ ///
+ string const & name() const {
+ return name_;
+ }
+ ///
+ string const & extension() const {
+ return extension_;
+ }
+ ///
+ string const & prettyname() const {
+ return prettyname_;
+ }
+ ///
+ string const & shortcut() const {
+ return shortcut_;
+ }
+ ///
+ string const & viewer() const {
+ return viewer_;
+ }
+ ///
+ void setViewer(string const & v) {
+ viewer_ = v;
+ }
+private:
+ string name_;
+ ///
+ string extension_;
+ ///
+ string prettyname_;
+ ///
+ string shortcut_;
+ ///
+ string viewer_;
+};
+
+
+inline
+bool operator<(Format const & a, Format const & b)
+{
+ return compare_no_case(a.prettyname(),b.prettyname()) < 0;
+}
+
+
+///
+class Formats {
+public:
+ ///
+ typedef std::vector<Format> FormatList;
+ ///
+ typedef FormatList::const_iterator const_iterator;
+ ///
+ Format const & Get(FormatList::size_type i) const {
+ return formatlist[i];
+ }
+ ///
+ 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 Delete(string const & name);
+ ///
+ void Sort();
+ ///
+ void SetViewer(string const & name, string const & command);
+ ///
+ bool View(Buffer const * buffer, string const & filename,
+ string const & format_name) const;