summaryrefslogtreecommitdiff
path: root/src/idbobject.h
diff options
context:
space:
mode:
authorNikita Kostovsky <nikita@kostovsky.me>2025-06-22 16:54:02 +0200
committerNikita Kostovsky <nikita@kostovsky.me>2025-06-22 16:54:02 +0200
commitf674e179d602d3ccb9818d28fe06f371059449dc (patch)
tree996fb624986512de91581a18332f004d34220ba2 /src/idbobject.h
parse and insert feeds and items
Diffstat (limited to 'src/idbobject.h')
-rw-r--r--src/idbobject.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/idbobject.h b/src/idbobject.h
new file mode 100644
index 0000000..8b04551
--- /dev/null
+++ b/src/idbobject.h
@@ -0,0 +1,24 @@
+#pragma once
+
+class IDbObject
+{
+public:
+ /*!
+ * \brief getDbId - check if object exists in db and return its id if any
+ * \return id on success, 0 otherwise
+ */
+ virtual int getDbId() = 0;
+
+ /*!
+ * \brief createInDb - create object in db
+ * \return new object id on success, 0 otherwise
+ */
+ virtual int createInDb() = 0;
+
+ /*!
+ * \brief getOrInsertDbId - get existing object id or try to create a new
+ * object and get its id
+ * \return existing or new object id on success, 0 otherwise
+ */
+ virtual int getOrInsertDbId() = 0;
+};