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

Method check_struct_begin

lib_acl_cpp/src/serialize/gsoner.cpp:439–533  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

437}
438
439bool gsoner::check_struct_begin(void)
440{
441 if(status_ != e_uninit) {
442 return false;
443 }
444
445 std::string struct_laber = codes_.substr(pos_, strlen("struct"));
446 std::string class_laber = codes_.substr(pos_, strlen("class"));
447
448 //struct user_t
449 if(struct_laber == "struct") {
450 pos_ += (int) strlen("struct");
451 } else if(class_laber == "class") {
452 pos_ += (int) strlen("class");
453 } else {
454 return false;
455 }
456
457 status_ = e_struct_begin;
458 std::string obj_name = next_token(default_delimiters_+ ":;{");
459 current_obj_.name_ = get_namespace()+obj_name;
460
461 if (codes_[pos_] == '{') {
462 pos_++;
463 return true;
464 }
465
466 if (codes_[pos_] == ';') {
467 pos_++;
468 //struct user_t ; end of struct;
469 status_ = e_uninit;
470 return true;
471 }
472
473 if (codes_[pos_] != ':') {
474 return true;
475 }
476
477 pos_++;
478 std::string token ;
479 std::string level;
480
481 while ((token = next_token(" \\\r\n\t,")) != "{") {
482 if(codes_[pos_] == ',') {
483 pos_++;
484 }
485
486 if (token == "public") {
487 level = "public";
488 continue;
489 }
490
491 if (token == "protect") {
492 level = "protect";
493 continue;
494 }
495
496 if (token == "private") {

Callers

nothing calls this directly

Calls 6

next_tokenFunction · 0.85
substrMethod · 0.80
beginMethod · 0.80
findMethod · 0.45
endMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected