MCPcopy Create free account
hub / github.com/acl-dev/acl / serialize

Method serialize

lib_acl_cpp/src/session/session.cpp:308–333  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

306// ���� handlersocket �ı��뷽ʽ
307
308void session::serialize(const std::map<string, session_string>& attrs,
309 string& out)
310{
311 out.clear(); // �����������
312
313 std::map<string, session_string>::const_iterator it = attrs.begin();
314 if (it == attrs.end()) {
315 return;
316 }
317
318 // ���ӵ�һ������
319 const char ch = 1;
320 escape(it->first.c_str(), it->first.length(), out);
321 escape(&ch, 1, out);
322 escape(it->second.c_str(), it->second.length(), out);
323 ++it;
324
325 // ���Ӻ���������
326 for (; it != attrs.end(); ++it) {
327 // ����һ������������Ķ���Ҫ���ӷָ���
328 out << '\t';
329 escape(it->first.c_str(), it->first.length(), out);
330 escape(&ch, 1, out);
331 escape(it->second.c_str(), it->second.length(), out);
332 }
333}
334
335// ���� handlersocket �Ľ��뷽ʽ
336

Callers

nothing calls this directly

Calls 6

beginMethod · 0.80
escapeFunction · 0.50
clearMethod · 0.45
endMethod · 0.45
c_strMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected