MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / transcode_class

Function transcode_class

internal/cbm/iris_export_xml.c:318–405  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

316}
317
318static char *transcode_class(CBMArena *arena, const char *cs, const char *ce) {
319 UdlBuf b;
320 ub_init(&b, arena);
321 if (!b.buf)
322 return NULL;
323 emit_header(&b, cs, ce);
324 const char *p = cs;
325 while (p < ce) {
326 p = skip_ws(p, ce);
327 if (p >= ce || *p != '<') {
328 if (p < ce)
329 p++;
330 continue;
331 }
332 if (sw(p, ce, "<Method ") || sw(p, ce, "<Method>")) {
333 const char *gt = find_s(p, ce, ">");
334 if (!gt)
335 break;
336 const char *me = find_s(gt + 1, ce, "</Method>");
337 if (!me) {
338 p = gt + 1;
339 continue;
340 }
341 emit_method(&b, p, me + strlen("</Method>"));
342 p = me + strlen("</Method>");
343 continue;
344 }
345 if (sw(p, ce, "<Property ")) {
346 const char *gt = find_s(p, ce, ">");
347 if (!gt)
348 break;
349 const char *pe = find_s(gt + 1, ce, "</Property>");
350 if (!pe) {
351 p = gt + 1;
352 continue;
353 }
354 emit_property(&b, p, pe + strlen("</Property>"));
355 p = pe + strlen("</Property>");
356 continue;
357 }
358 if (sw(p, ce, "<Parameter ")) {
359 const char *gt = find_s(p, ce, ">");
360 if (!gt)
361 break;
362 if (is_self_closing(p, gt)) {
363 p = gt + 1;
364 continue;
365 }
366 const char *pe = find_s(gt + 1, ce, "</Parameter>");
367 if (!pe) {
368 p = gt + 1;
369 continue;
370 }
371 emit_parameter(&b, p, pe + strlen("</Parameter>"));
372 p = pe + strlen("</Parameter>");
373 continue;
374 }
375 if (sw(p, ce, "<Index ") || sw(p, ce, "<Index>")) {

Callers 1

cbm_iris_export_to_udlFunction · 0.85

Calls 13

ub_initFunction · 0.85
swFunction · 0.85
find_sFunction · 0.85
emit_methodFunction · 0.85
emit_propertyFunction · 0.85
is_self_closingFunction · 0.85
emit_parameterFunction · 0.85
emit_indexFunction · 0.85
emit_xdataFunction · 0.85
skip_tagFunction · 0.85
ub_appFunction · 0.85
emit_headerFunction · 0.70

Tested by

no test coverage detected