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