| 375 | } |
| 376 | |
| 377 | void WriteScriptParamsToRAM(const ScriptParamMap &spm, std::vector<char> &data) { |
| 378 | int num_params = spm.size(); |
| 379 | memwrite(&num_params, sizeof(int), 1, data); |
| 380 | ScriptParamMap::const_iterator iter = spm.begin(); |
| 381 | for (; iter != spm.end(); ++iter) { |
| 382 | { |
| 383 | const std::string &str = iter->first; |
| 384 | int str_len = str.size(); |
| 385 | memwrite(&str_len, sizeof(int), 1, data); |
| 386 | memwrite(&str[0], sizeof(char), str_len, data); |
| 387 | } |
| 388 | const ScriptParam &sp = iter->second; |
| 389 | sp.WriteToRAM(data); |
| 390 | } |
| 391 | } |
| 392 | |
| 393 | const std::string &ScriptParam::GetString() const { |
| 394 | if (type_ != STRING && type_ != JSON) { |
no test coverage detected