| 81 | } |
| 82 | |
| 83 | bool net_store::get_key(const char* name, acl::string& out) |
| 84 | { |
| 85 | acl::db_handle* db = open_option_tbl(); |
| 86 | if (db == NULL) |
| 87 | return false; |
| 88 | acl::string sql; |
| 89 | sql.format("select value from option_tbl where name='%s'", name); |
| 90 | if (db->sql_select(sql.c_str()) == false) |
| 91 | { |
| 92 | delete db; |
| 93 | return false; |
| 94 | } |
| 95 | |
| 96 | const acl::db_row* row = db->get_first_row(); |
| 97 | if (row == NULL) |
| 98 | { |
| 99 | delete db; |
| 100 | return false; |
| 101 | } |
| 102 | const char* value = (*row)["value"]; |
| 103 | if (value == NULL) |
| 104 | { |
| 105 | db->free_result(); |
| 106 | delete db; |
| 107 | return false; |
| 108 | } |
| 109 | out = value; |
| 110 | return true; |
| 111 | } |
| 112 | |
| 113 | bool net_store::set_key(const char* name, const char* value) |
| 114 | { |
nothing calls this directly
no test coverage detected