| 67 | } |
| 68 | |
| 69 | const Switches::in_sw_tab_t* Switches::findSwitch(Firebird::string sw, bool* invalidSwitchInd) const |
| 70 | { |
| 71 | /************************************** |
| 72 | * |
| 73 | * f i n d S w i t c h |
| 74 | * |
| 75 | ************************************** |
| 76 | * |
| 77 | * Functional description |
| 78 | * Returns pointer to in_sw_tab entry for current switch |
| 79 | * If not a switch, returns NULL. |
| 80 | * If no match, invalidSwitch is set to true (if the pointer is given) |
| 81 | * |
| 82 | **************************************/ |
| 83 | if (sw.isEmpty() || sw[0] != switch_char) |
| 84 | { |
| 85 | return 0; |
| 86 | } |
| 87 | if (sw.length() == 1) |
| 88 | { |
| 89 | if (invalidSwitchInd) |
| 90 | *invalidSwitchInd = true; |
| 91 | return 0; |
| 92 | } |
| 93 | |
| 94 | sw.erase(0, 1); |
| 95 | sw.upper(); |
| 96 | |
| 97 | FB_SIZE_T iter = 0; |
| 98 | for (const in_sw_tab_t* in_sw_tab = m_base; in_sw_tab->in_sw_name; ++in_sw_tab, ++iter) |
| 99 | { |
| 100 | if ((!m_minLength || sw.length() >= in_sw_tab->in_sw_min_length) && |
| 101 | matchSwitch(sw, in_sw_tab->in_sw_name, m_opLengths[iter])) |
| 102 | { |
| 103 | return in_sw_tab; |
| 104 | } |
| 105 | } |
| 106 | fb_assert(iter == m_count - 1); |
| 107 | if (invalidSwitchInd) |
| 108 | *invalidSwitchInd = true; |
| 109 | |
| 110 | return 0; |
| 111 | } |
| 112 | |
| 113 | Switches::in_sw_tab_t* Switches::findSwitchMod(Firebird::string& sw, bool* invalidSwitchInd) |
| 114 | { |
no test coverage detected