QtNovelUI/WordsIDE/route.h

36 lines
736 B
C
Raw Permalink Normal View History

#ifndef ROUTE_H
#define ROUTE_H
#include <qstringlist.h>
namespace Core {
class Route
{
public:
Route();
2023-03-17 13:58:38 +00:00
Route(const Route &other);
bool isValid() const;
QStringList links() const;
Route operator|(const QString &node) const;
bool operator==(const Route &other) const;
2023-03-17 13:58:38 +00:00
bool operator<(const Route &other) const;
void append(const QString &node);
void prepend(const QString &node);
static Route collect(const QList<QString> &list);
2023-03-17 13:58:38 +00:00
private:
QStringList links_store;
};
2023-03-17 13:58:38 +00:00
inline uint qHash(const Core::Route &v, uint seed) {
return qHash(v.links().join("/"), seed);
}
} // namespace Core
#endif // ROUTE_H