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

Function acl_foreach

lib_acl_cpp/src/session/session.cpp:343–367  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

341 ACL_ARGV* tokens = acl_argv_split(buf.c_str(), "\t");
342 ACL_ITER iter;
343 acl_foreach(iter, tokens) {
344 char* ptr = (char*) iter.data;
345
346 // �ظ�ʹ��ԭ�����ڴ�������Ϊ tokens ���Ѿ��洢���м�������
347 buf.clear();
348 if (!unescape(ptr, strlen(ptr), buf)) {
349 logger_error("unescape error");
350 continue;
351 }
352 ptr = buf.c_str();
353 // ��Ϊ acl::string �϶��ܱ�֤���������ݵ�β���� \0����������
354 // strchr ʱ�����뵣��Խ�����⣬�� std::string ������֤����
355 char* p1 = strchr(ptr, 1);
356 if (p1 == NULL || *(p1 + 1) == 0) {
357 continue;
358 }
359 *p1++ = 0;
360 //std::map<string, session_string>::iterator it = attrs.find(ptr);
361
362 size_t len = buf.length() - (p1 - buf.c_str());
363 session_string ss(len);
364 ss.copy(p1, len);
365 ss.todo_ = TODO_SET;
366 attrs.insert(std::make_pair(string(ptr), ss));
367 }
368
369 acl_argv_free(tokens);
370}

Callers

nothing calls this directly

Calls 6

insertMethod · 0.80
unescapeFunction · 0.50
stringClass · 0.50
clearMethod · 0.45
c_strMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…