--- /dev/null
+#include "../include/localidentity.h"\r
+\r
+#ifdef XMEM\r
+ #include <xmem.h>\r
+#endif\r
+\r
+LocalIdentity::LocalIdentity()\r
+{\r
+ Initialize();\r
+}\r
+\r
+void LocalIdentity::Initialize()\r
+{\r
+ m_id=-1;\r
+ m_name="";\r
+ m_publickey="";\r
+ m_privatekey=""; \r
+}\r
+\r
+const bool LocalIdentity::Load(const int id)\r
+{\r
+\r
+ Initialize();\r
+\r
+ SQLite3DB::Statement st=m_db->Prepare("SELECT LocalIdentityID,Name,PublicKey,PrivateKey FROM tblLocalIdentity WHERE LocalIdentityID=?;");\r
+ st.Bind(0,id);\r
+ st.Step();\r
+ if(st.RowReturned())\r
+ {\r
+ st.ResultInt(0,m_id);\r
+ st.ResultText(1,m_name);\r
+ st.ResultText(2,m_publickey);\r
+ st.ResultText(3,m_privatekey);\r
+ return true;\r
+ }\r
+ else\r
+ {\r
+ return false;\r
+ }\r
+\r
+}\r
+\r
+const bool LocalIdentity::Load(const std::string &name)\r
+{\r
+ Initialize();\r
+\r
+ SQLite3DB::Statement st=m_db->Prepare("SELECT LocalIdentityID FROM tblLocalIdentity WHERE Name=?;");\r
+ st.Bind(0,name);\r
+ st.Step();\r
+ if(st.RowReturned())\r
+ {\r
+ int id=-1;\r
+ st.ResultInt(0,id);\r
+ return Load(id);\r
+ }\r
+ else\r
+ {\r
+ return false;\r
+ }\r
+}
\ No newline at end of file