X-Git-Url: https://git.sven.stormbind.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Fvymlock.h;fp=src%2Fvymlock.h;h=c32a2a9f43c64bf1774b361abb17558febe2cf2a;hb=d483bd8e6523c23c6f1d8908a2e0611c2bc9ff4f;hp=0000000000000000000000000000000000000000;hpb=7dfa3fe589d1722d49681f42cdb0bf1e6efb5223;p=sven%2Fvym.git

diff --git a/src/vymlock.h b/src/vymlock.h
new file mode 100644
index 0000000..c32a2a9
--- /dev/null
+++ b/src/vymlock.h
@@ -0,0 +1,33 @@
+#ifndef VYMLOCK_H
+#define VYMLOCK_H
+
+extern bool debug;
+
+class VymLock {
+  public:
+    enum LockState { Undefined, LockedByMyself, LockedByOther, NotWritable };
+    void operator==(const VymLock &);
+    VymLock();
+    VymLock(const QString &fn);
+    ~VymLock();
+    void init();
+    bool tryLock();
+    LockState getState();
+    bool releaseLock();
+    bool removeLockForced();
+    void setAuthor(const QString &s);
+    QString getAuthor();
+    void setHost(const QString &s);
+    QString getHost();
+    void setMapPath(const QString &path);
+    QString getMapPath();
+
+  private:
+    QString author;
+    QString host;
+    QString mapPath;
+    QString lockPath;
+    LockState state;
+};
+
+#endif