summaryrefslogtreecommitdiff
path: root/include/modules/ns_cert.h
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-07-01 22:17:52 -0400
committerAdam <Adam@anope.org>2013-07-01 22:17:52 -0400
commit1a3d9a016d3adc49788bbff73aac9b3b5ea85b17 (patch)
treec0ecf92ed768473bc82ff64a7fce827245f37ba9 /include/modules/ns_cert.h
parent518182ac9204f815258b0de91b3f884d8efa1502 (diff)
Change extensible keys to require explicitly having a type defined for it. Completely modularize more features like bs_kick, entrymsg, log, mode, etc. Move fantasy to its own module. Move greet to its own module.
Diffstat (limited to 'include/modules/ns_cert.h')
-rw-r--r--include/modules/ns_cert.h61
1 files changed, 61 insertions, 0 deletions
diff --git a/include/modules/ns_cert.h b/include/modules/ns_cert.h
new file mode 100644
index 000000000..8587cdfb2
--- /dev/null
+++ b/include/modules/ns_cert.h
@@ -0,0 +1,61 @@
+/* NickServ core functions
+ *
+ * (C) 2003-2013 Anope Team
+ * Contact us at team@anope.org
+ *
+ * Please read COPYING and README for further details.
+ *
+ * Based on the original code of Epona by Lara.
+ * Based on the original code of Services by Andy Church.
+ */
+
+struct NSCertList
+{
+ protected:
+ NSCertList() { }
+ public:
+
+ /** Add an entry to the nick's certificate list
+ *
+ * @param entry The fingerprint to add to the cert list
+ *
+ * Adds a new entry into the cert list.
+ */
+ virtual void AddCert(const Anope::string &entry) = 0;
+
+ /** Get an entry from the nick's cert list by index
+ *
+ * @param entry Index in the certificaate list vector to retrieve
+ * @return The fingerprint entry of the given index if within bounds, an empty string if the vector is empty or the index is out of bounds
+ *
+ * Retrieves an entry from the certificate list corresponding to the given index.
+ */
+ virtual Anope::string GetCert(unsigned entry) const = 0;
+
+ virtual unsigned GetCertCount() const = 0;
+
+ /** Find an entry in the nick's cert list
+ *
+ * @param entry The fingerprint to search for
+ * @return True if the fingerprint is found in the cert list, false otherwise
+ *
+ * Search for an fingerprint within the cert list.
+ */
+ virtual bool FindCert(const Anope::string &entry) const = 0;
+
+ /** Erase a fingerprint from the nick's certificate list
+ *
+ * @param entry The fingerprint to remove
+ *
+ * Removes the specified fingerprint from the cert list.
+ */
+ virtual void EraseCert(const Anope::string &entry) = 0;
+
+ /** Clears the entire nick's cert list
+ *
+ * Deletes all the memory allocated in the certificate list vector and then clears the vector.
+ */
+ virtual void ClearCert() = 0;
+
+ virtual void Check() = 0;
+};