| 767 | |
| 768 | |
| 769 | void TracePluginImpl::str2Array(const Firebird::string& str, GdsCodesArray& arr) |
| 770 | { |
| 771 | // input: string with comma-delimited list of gds codes values and\or gds codes names |
| 772 | // output: sorted array of gds codes values |
| 773 | |
| 774 | const char *sep = " ,"; |
| 775 | |
| 776 | FB_SIZE_T p1 = 0, p2 = 0; |
| 777 | while (p2 < str.length()) |
| 778 | { |
| 779 | p2 = str.find_first_of(sep, p1); |
| 780 | if (p2 == string::npos) |
| 781 | p2 = str.length(); |
| 782 | |
| 783 | string s = str.substr(p1, p2 - p1); |
| 784 | |
| 785 | ISC_STATUS code = atol(s.c_str()); |
| 786 | |
| 787 | if (!code && !(code = MsgUtil::getCodeByName(s.c_str()))) |
| 788 | { |
| 789 | fatal_exception::raiseFmt( |
| 790 | "Error parsing error codes filter: \n" |
| 791 | "\t%s\n" |
| 792 | "\tbad item is: %s, at position: %d", |
| 793 | str.c_str(), s.c_str(), p1 + 1); |
| 794 | } |
| 795 | |
| 796 | // avoid duplicates |
| 797 | |
| 798 | FB_SIZE_T ins_pos; |
| 799 | if (!arr.find(code, ins_pos)) |
| 800 | arr.insert(ins_pos, code); |
| 801 | |
| 802 | p1 = str.find_first_not_of(sep, p2); |
| 803 | } |
| 804 | } |
| 805 | |
| 806 | |
| 807 | void TracePluginImpl::appendParams(ITraceParams* params) |
nothing calls this directly
no test coverage detected