/ CheckPath: Checks whether the path exists in the document. */ /
| 691 | /* CheckPath: Checks whether the path exists in the document. */ |
| 692 | /*********************************************************************************/ |
| 693 | my_bool JSNX::CheckPath(PGLOBAL g) |
| 694 | { |
| 695 | PJVAL val= NULL; |
| 696 | PJSON row = Row; |
| 697 | |
| 698 | for (int i = 0; i < Nod && row; i++) { |
| 699 | val = NULL; |
| 700 | |
| 701 | if (Nodes[i].Op == OP_NUM || Nodes[i].Op == OP_XX) { |
| 702 | } else switch (row->GetType()) { |
| 703 | case TYPE_JOB: |
| 704 | if (Nodes[i].Key) |
| 705 | val = ((PJOB)row)->GetKeyValue(Nodes[i].Key); |
| 706 | |
| 707 | break; |
| 708 | case TYPE_JAR: |
| 709 | if (!Nodes[i].Key) |
| 710 | if (Nodes[i].Op == OP_EQ || Nodes[i].Op == OP_LE) |
| 711 | val = ((PJAR)row)->GetArrayValue(Nodes[i].Rank); |
| 712 | |
| 713 | break; |
| 714 | case TYPE_JVAL: |
| 715 | val = (PJVAL)row; |
| 716 | break; |
| 717 | default: |
| 718 | snprintf(g->Message, sizeof(g->Message), "Invalid row JSON type %d", row->GetType()); |
| 719 | } // endswitch Type |
| 720 | |
| 721 | if (i < Nod-1) |
| 722 | if (!(row = (val) ? val->GetJsp() : NULL)) |
| 723 | val = NULL; |
| 724 | |
| 725 | } // endfor i |
| 726 | |
| 727 | return (val != NULL); |
| 728 | } // end of CheckPath |
| 729 | |
| 730 | /***********************************************************************/ |
| 731 | /* GetRow: Set the complete path of the object to be set. */ |
no test coverage detected