Lines Matching refs:Stack
24 #include <stack>
33 struct Stack {
35 std::stack<xml::Node*> nodeStack;
57 static void addToStack(Stack* stack, XML_Parser parser, std::unique_ptr<Node> node) {
62 if (!stack->nodeStack.empty()) {
63 stack->nodeStack.top()->addChild(std::move(node));
65 stack->root = std::move(node);
69 stack->nodeStack.push(thisNode);
75 Stack* stack = reinterpret_cast<Stack*>(XML_GetUserData(parser));
86 addToStack(stack, parser, std::move(ns));
91 Stack* stack = reinterpret_cast<Stack*>(XML_GetUserData(parser));
93 assert(!stack->nodeStack.empty());
94 stack->nodeStack.pop();
104 Stack* stack = reinterpret_cast<Stack*>(XML_GetUserData(parser));
120 el->comment = std::move(stack->pendingComment);
121 addToStack(stack, parser, std::move(el));
126 Stack* stack = reinterpret_cast<Stack*>(XML_GetUserData(parser));
128 assert(!stack->nodeStack.empty());
129 //stack->nodeStack.top()->comment = std::move(stack->pendingComment);
130 stack->nodeStack.pop();
135 Stack* stack = reinterpret_cast<Stack*>(XML_GetUserData(parser));
142 if (!stack->nodeStack.empty()) {
143 Node* currentParent = stack->nodeStack.top();
155 addToStack(stack, parser, std::move(text));
160 Stack* stack = reinterpret_cast<Stack*>(XML_GetUserData(parser));
162 if (!stack->pendingComment.empty()) {
163 stack->pendingComment += '\n';
165 stack->pendingComment += util::utf8ToUtf16(comment);
169 Stack stack;
172 XML_SetUserData(parser, &stack);
183 stack.root = {};
189 stack.root = {};
197 if (stack.root) {
198 return util::make_unique<XmlResource>(ResourceFile{ {}, {}, source }, std::move(stack.root));
236 std::stack<Node*> nodeStack;