27 memcpy(buf,str.c_str(),str.length());
36 sprintf(buf,
"%c (%#x) ", (ch>=
' ')?ch:
'.', *
reinterpret_cast<unsigned char*
>(&ch));
44 for (
auto& it : data) {
45 string key = it.first;
46 string val = it.second;
47 len += 4 + key.length() + 1 + val.length();
49 string result(len,
'\0');
50 char *buf = (
char *)result.c_str();
51 for (
auto& it : data) {
52 string key = it.first;
53 string val = it.second;
54 appendInt32(buf,key.length()+1+val.length());
55 appendString(buf,key);
56 appendString(buf,
string(
"="));
57 appendString(buf,val);
66 unsigned int len = bin.length();
67 char *at = (
char*) bin.c_str();
74 string keyval(at,slen);
75 size_t delim = keyval.find_first_of(
'=',0);
76 if (delim == string::npos) {
79 string key = keyval.substr(0,delim);
80 string val = keyval.substr(delim+1);
92 for (
const auto& it : data) {
93 string key = it.first;
94 string val = it.second;