------------------------------------------------------------------------------
| 101 | |
| 102 | //------------------------------------------------------------------------------ |
| 103 | bool GetIntArray(const Json::Value& root, std::vector<int>& value) |
| 104 | { |
| 105 | if (root.empty() || !root.isArray()) |
| 106 | { |
| 107 | return false; |
| 108 | } |
| 109 | value.reserve(root.size()); |
| 110 | for (const auto& intValue : root) |
| 111 | { |
| 112 | if (intValue.empty() && !intValue.isInt()) |
| 113 | { |
| 114 | value.clear(); |
| 115 | return false; |
| 116 | } |
| 117 | value.push_back(intValue.asInt()); |
| 118 | } |
| 119 | if (value.empty()) |
| 120 | { |
| 121 | value.clear(); |
| 122 | return false; |
| 123 | } |
| 124 | return true; |
| 125 | } |
| 126 | |
| 127 | //------------------------------------------------------------------------------ |
| 128 | bool GetUIntArray(const Json::Value& root, std::vector<unsigned int>& value) |