#ifndef MENUPATH_H #define MENUPATH_H #include #include #include /// For a menu path we use a string very similar to a file path. Width however the addition of semicolons /// for specifying groups. So the following path /// /// /File:Save /// /// Specifies the File menu and the group Save within that menu while /// /// /File/Export /// /// Would specify the export sub menu of the file menu /// class MenuPath { public: MenuPath(); MenuPath(QString menu_path); private: class Elem { public: QStringRef menu; QStringRef group; explicit Elem(QStringRef s) { auto p = s.split(':'); menu = p[0]; if (p.size() > 1) { group = p[1]; } } }; std::vector m_elems; }; #endif // MENUPATH_H