| 2492 | } |
| 2493 | |
| 2494 | std::string Parser::UnqualifiedName(const std::string &full_qualified_name) { |
| 2495 | Namespace *ns = new Namespace(); |
| 2496 | |
| 2497 | std::size_t current, previous = 0; |
| 2498 | current = full_qualified_name.find('.'); |
| 2499 | while (current != std::string::npos) { |
| 2500 | ns->components.push_back( |
| 2501 | full_qualified_name.substr(previous, current - previous)); |
| 2502 | previous = current + 1; |
| 2503 | current = full_qualified_name.find('.', previous); |
| 2504 | } |
| 2505 | current_namespace_ = UniqueNamespace(ns); |
| 2506 | return full_qualified_name.substr(previous, current - previous); |
| 2507 | } |
| 2508 | |
| 2509 | static bool compareFieldDefs(const FieldDef *a, const FieldDef *b) { |
| 2510 | auto a_id = atoi(a->attributes.Lookup("id")->constant.c_str()); |