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

Method del

lib_acl_cpp/src/hsocket/hsclient.cpp:252–287  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

250}
251
252bool hsclient::del(const char* values[], int num,
253 const char* cond /* = "=" */, int nlimit /* = 1 */, int noffset /* = 0 */)
254{
255 if (tbl_curr_ == NULL) {
256 error_ = HS_ERR_NOT_OPEN;
257 logger_error("tbl not opened yet!");
258 return false;
259 } else if (values == NULL || values[0] == NULL) {
260 error_ = HS_ERR_PARAMS;
261 logger_error("values null");
262 return false;
263 } else if (num <= 0 || num > tbl_curr_->nfld_) {
264 error_ = HS_ERR_PARAMS;
265 logger_error("num(%d) invalid, nfld(%d)",
266 num, tbl_curr_->nfld_);
267 return false;
268 } else if (cond == NULL || *cond == 0) {
269 error_ = HS_ERR_PARAMS;
270 logger_error("cond null");
271 return false;
272 }
273
274 if (nlimit <= 0) {
275 nlimit = 1;
276 }
277 if (noffset < 0) {
278 noffset = 0;
279 }
280 char buf[32], *limit_offset = NULL;
281 if (nlimit > 1) {
282 safe_snprintf(buf, sizeof(buf), "%d\t%d", nlimit, noffset);
283 limit_offset = buf;
284 }
285
286 return query(cond, values, num, limit_offset, 'D', 0, 0);
287}
288
289bool hsclient::fmt_del(const char* first_value, ...)
290{

Callers 1

removeAttributeMethod · 0.45

Calls 2

safe_snprintfFunction · 0.85
queryClass · 0.50

Tested by

no test coverage detected