387{
389
390
391 switch (tid) {
392 default:
393 cm_msg(
MERROR,
"db_paste_json",
"do not know what to do with tid %d at \"%s\"", tid, path);
394
397 cm_msg(
MERROR,
"db_paste_json",
"paste of TID_ARRAY is not implemented at \"%s\"", path);
400 cm_msg(
MERROR,
"db_paste_json",
"paste of TID_STRUCT is not implemented at \"%s\"", path);
403 cm_msg(
MERROR,
"db_paste_json",
"paste of TID_BITFIELD is not implemented at \"%s\"", path);
406 const std::string
value =
node->GetString();
407 int size = 1;
410 cm_msg(
MERROR,
"db_paste_json",
"cannot set TID_CHAR value for \"%s\", db_set_data_index() status %d", path,
status);
412 }
414 }
418 v = true;
420 v = false;
422 v = true;
424 v = false;
426 v = true;
428 v = false;
430 v = true;
432 v = false;
434 v = true;
436 v = false;
437 } else {
444 }
445 int size = sizeof(v);
448 cm_msg(
MERROR,
"db_paste_json",
"cannot set TID_BOOL value for \"%s\", db_set_data_index() status %d", path,
status);
450 }
452 }
460 int size = sizeof(b);
463 cm_msg(
MERROR,
"db_paste_json",
"cannot set TID_BYTE/TID_SBYTE value for \"%s\", db_set_data_index() status %d", path,
status);
465 }
467 }
475 int size = sizeof(v);
478 cm_msg(
MERROR,
"db_paste_json",
"cannot set TID_WORD/TID_SHORT value for \"%s\", db_set_data_index() status %d", path,
status);
480 }
482 }
488 int size = sizeof(v);
491 cm_msg(
MERROR,
"db_paste_json",
"cannot set TID_DWORD value for \"%s\", db_set_data_index() status %d", path,
status);
493 }
495 }
497 int v = 0;
498 switch (
node->GetType()) {
499 default:
500 cm_msg(
MERROR,
"db_paste_json",
"unexpected node type %d at \"%s\"",
node->GetType(), path);
504 break;
505 }
507 double dv =
node->GetDouble();
509 cm_msg(
MERROR,
"db_paste_json",
"numeric value %f out of range at \"%s\"",
dv, path);
511 }
513 break;
514 }
519 break;
520 }
521 }
522 int size = sizeof(v);
525 cm_msg(
MERROR,
"db_paste_json",
"cannot set TID_INT value for \"%s\", db_set_data_index() status %d", path,
status);
527 }
529 }
530
536 int size = sizeof(v);
539 cm_msg(
MERROR,
"db_paste_json",
"cannot set TID_UINT64 value for \"%s\", db_set_data_index() status %d", path,
status);
541 }
543 }
544
550 int size = sizeof(v);
553 cm_msg(
MERROR,
"db_paste_json",
"cannot set TID_INT64 value for \"%s\", db_set_data_index() status %d", path,
status);
555 }
557 }
558
565 int size = sizeof(v);
568 cm_msg(
MERROR,
"db_paste_json",
"cannot set TID_FLOAT value for \"%s\", db_set_data_index() status %d", path,
status);
570 }
572 }
574 double v;
578 int size = sizeof(v);
581 cm_msg(
MERROR,
"db_paste_json",
"cannot set TID_DOUBLE value for \"%s\", db_set_data_index() status %d", path,
status);
583 }
585 }
588 const char* ptr =
NULL;
589 int size = 0;
590 const std::string
value =
node->GetString();
593
597 ptr = buf;
599 } else {
602 }
603
608 cm_msg(
MERROR,
"db_paste_json",
"cannot get key of string array for \"%s\", db_get_key() status %d", path,
status);
610 }
611
615 cm_msg(
MERROR,
"db_paste_json",
"cannot change array string length from %d to %d for \"%s\", db_resize_string() status %d",
key.
item_size, size, path,
status);
617 }
618 }
619 }
620
621
622
626 } else {
628 }
629 }
else if (
index != 0) {
630 cm_msg(
MERROR,
"db_paste_json",
"cannot set TID_STRING value for \"%s\" index %d, it is not an array", path,
index);
632 } else {
634 }
635
636 if (buf)
637 delete[] buf;
638
640 cm_msg(
MERROR,
"db_paste_json",
"cannot set TID_STRING value for \"%s\", db_set_data_index() status %d", path,
status);
642 }
643
645 }
650
652
654 cm_msg(
MERROR,
"db_paste_json",
"cannot set TID_LINK value for \"%s\", db_set_data() status %d", path,
status);
656 }
657
659 }
660 }
661
662}
INT db_set_data(HNDLE hDB, HNDLE hKey, const void *data, INT buf_size, INT num_values, DWORD type)
INT EXPRT db_resize_string(HNDLE hdb, HNDLE hKeyRoot, const char *key_name, int num_values, int max_string_length)
static int GetDOUBLE(const MJsonNode *node, const char *path, double *dw)
static int GetDWORD(const MJsonNode *node, const char *path, DWORD *dw)
static int GetQWORD(const MJsonNode *node, const char *path, UINT64 *qw)
unsigned long long UINT64