• Home
  • Raw
  • Download

Lines Matching refs:stack

44   std::stack<xml::Element*> node_stack;
66 static void FinishPendingText(Stack* stack) { in FinishPendingText() argument
67 if (stack->last_text_node != nullptr) { in FinishPendingText()
68 if (!stack->last_text_node->text.empty()) { in FinishPendingText()
69 CHECK(!stack->node_stack.empty()); in FinishPendingText()
70 stack->node_stack.top()->AppendChild(std::move(stack->last_text_node)); in FinishPendingText()
74 stack->last_text_node = nullptr; in FinishPendingText()
80 Stack* stack = reinterpret_cast<Stack*>(XML_GetUserData(parser)); in StartNamespaceHandler() local
81 FinishPendingText(stack); in StartNamespaceHandler()
89 if (stack->pending_element == nullptr) { in StartNamespaceHandler()
90 stack->pending_element = util::make_unique<Element>(); in StartNamespaceHandler()
92 stack->pending_element->namespace_decls.push_back(std::move(decl)); in StartNamespaceHandler()
97 Stack* stack = reinterpret_cast<Stack*>(XML_GetUserData(parser)); in EndNamespaceHandler() local
98 FinishPendingText(stack); in EndNamespaceHandler()
108 Stack* stack = reinterpret_cast<Stack*>(XML_GetUserData(parser)); in StartElementHandler() local
109 FinishPendingText(stack); in StartElementHandler()
112 if (stack->pending_element != nullptr) { in StartElementHandler()
113 el = std::move(stack->pending_element); in StartElementHandler()
120 el->comment = std::move(stack->pending_comment); in StartElementHandler()
136 if (!stack->node_stack.empty()) { in StartElementHandler()
137 stack->node_stack.top()->AppendChild(std::move(el)); in StartElementHandler()
139 stack->root = std::move(el); in StartElementHandler()
141 stack->node_stack.push(this_el); in StartElementHandler()
146 Stack* stack = reinterpret_cast<Stack*>(XML_GetUserData(parser)); in EndElementHandler() local
147 FinishPendingText(stack); in EndElementHandler()
149 CHECK(!stack->node_stack.empty()); in EndElementHandler()
151 stack->node_stack.pop(); in EndElementHandler()
156 Stack* stack = reinterpret_cast<Stack*>(XML_GetUserData(parser)); in CharacterDataHandler() local
164 if (stack->last_text_node != nullptr) { in CharacterDataHandler()
165 stack->last_text_node->text.append(str.data(), str.size()); in CharacterDataHandler()
169 stack->last_text_node = util::make_unique<Text>(); in CharacterDataHandler()
170 stack->last_text_node->line_number = XML_GetCurrentLineNumber(parser); in CharacterDataHandler()
171 stack->last_text_node->column_number = XML_GetCurrentColumnNumber(parser); in CharacterDataHandler()
172 stack->last_text_node->text = str.to_string(); in CharacterDataHandler()
177 Stack* stack = reinterpret_cast<Stack*>(XML_GetUserData(parser)); in CommentDataHandler() local
178 FinishPendingText(stack); in CommentDataHandler()
180 if (!stack->pending_comment.empty()) { in CommentDataHandler()
181 stack->pending_comment += '\n'; in CommentDataHandler()
183 stack->pending_comment += comment; in CommentDataHandler()
187 Stack stack; in Inflate() local
191 XML_SetUserData(parser.get(), &stack); in Inflate()
220 StringPool{}, std::move(stack.root)); in Inflate()
275 std::stack<Element*> node_stack; in Inflate()