| 742 | } |
| 743 | |
| 744 | bool Document::checkPair(std::string& _key, std::string& _value) |
| 745 | { |
| 746 | // в ключе не должно быть ковычек и пробелов |
| 747 | MyGUI::utility::trim(_key); |
| 748 | if (_key.empty()) |
| 749 | return false; |
| 750 | size_t start = _key.find_first_of(" \t\"\'&"); |
| 751 | if (start != std::string::npos) |
| 752 | return false; |
| 753 | |
| 754 | // в значении, ковычки по бокам |
| 755 | MyGUI::utility::trim(_value); |
| 756 | if (_value.size() < 2) |
| 757 | return false; |
| 758 | if (((_value[0] != '"') || (_value[_value.length() - 1] != '"')) && |
| 759 | ((_value[0] != '\'') || (_value[_value.length() - 1] != '\''))) |
| 760 | return false; |
| 761 | bool ok = true; |
| 762 | _value = utility::convert_from_xml(_value.substr(1, _value.length() - 2), ok); |
| 763 | return ok; |
| 764 | } |
| 765 | |
| 766 | // ищет символ без учета ковычек |
| 767 | size_t Document::find(std::string_view _text, char _char, size_t _start) |
nothing calls this directly
no test coverage detected