MCPcopy Create free account
hub / github.com/acl-dev/acl / set_key

Method set_key

app/net_tools/net_store.cpp:113–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111}
112
113bool net_store::set_key(const char* name, const char* value)
114{
115 acl::db_handle* db = open_option_tbl();
116 if (db == NULL)
117 return false;
118
119 acl::string sql;
120 sql.format("insert into option_tbl(name, value) values('%s', '%s')",
121 name, value);
122 if (db->sql_update(sql.c_str()) == false)
123 {
124 sql.format("update option_tbl set value='%s' where name='%s'",
125 value, name);
126 db->sql_update(sql.c_str());
127 delete db;
128 return false;
129 }
130 else
131 {
132 delete db;
133 return true;
134 }
135}
136
137//////////////////////////////////////////////////////////////////////////
138// ���߳�������

Callers 1

proc_on_initMethod · 0.45

Calls 4

open_option_tblFunction · 0.85
formatMethod · 0.45
sql_updateMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected