Home | History | Annotate | Download | only in xml

Lines Matching refs:node

17 bool SkXMLParser::parse(const SkDOM& dom, const SkDOMNode* node)
19 const char* elemName = dom.getName(node);
24 SkDOM::AttrIter iter(dom, node);
31 if ((node = dom.getFirstChild(node)) != nullptr)
33 if (!this->parse(dom, node))
35 } while ((node = dom.getNextSibling(node)) != nullptr);
77 const SkDOM::Node* SkDOM::getRootNode() const
82 const SkDOM::Node* SkDOM::getFirstChild(const Node* node, const char name[]) const
84 SkASSERT(node);
85 const Node* child = node->fFirstChild;
96 const SkDOM::Node* SkDOM::getNextSibling(const Node* node, const char name[]) const
98 SkASSERT(node);
99 const Node* sibling = node->fNextSibling;
109 SkDOM::Type SkDOM::getType(const Node* node) const
111 SkASSERT(node);
112 return (Type)node->fType;
115 const char* SkDOM::getName(const Node* node) const
117 SkASSERT(node);
118 return node->fName;
121 const char* SkDOM::findAttr(const Node* node, const char name[]) const
123 SkASSERT(node);
124 const Attr* attr = node->attrs();
125 const Attr* stop = attr + node->fAttrCount;
138 const SkDOM::Attr* SkDOM::getFirstAttr(const Node* node) const
140 return node->fAttrCount ? node->attrs() : nullptr;
143 const SkDOM::Attr* SkDOM::getNextAttr(const Node* node, const Attr* attr) const
145 SkASSERT(node);
148 return (attr - node->attrs() + 1) < node->fAttrCount ? attr + 1 : nullptr;
151 const char* SkDOM::getAttrName(const Node* node, const Attr* attr) const
153 SkASSERT(node);
158 const char* SkDOM::getAttrValue(const Node* node, const Attr* attr) const
160 SkASSERT(node);
167 SkDOM::AttrIter::AttrIter(const SkDOM&, const SkDOM::Node* node)
169 SkASSERT(node);
170 fAttr = node->attrs();
171 fStop = fAttr + node->fAttrCount;
211 SkDOM::Node* getRoot() const { return fRoot; }
221 SkDOM::Node* node = (SkDOM::Node*)fAlloc->alloc(sizeof(SkDOM::Node) + attrCount * sizeof(SkDOM::Attr),
224 node->fName = fElemName;
225 node->fFirstChild = nullptr;
226 node->fAttrCount = SkToU16(attrCount);
227 node->fType = fElemType;
231 node->fNextSibling = nullptr;
232 fRoot = node;
236 SkDOM::Node* parent = fParentStack.top();
238 node->fNextSibling = parent->fFirstChild;
239 parent->fFirstChild = node;
241 *fParentStack.push() = node;
243 sk_careful_memcpy(node->attrs(), fAttrs.begin(), attrCount * sizeof(SkDOM::Attr));
266 SkDOM::Node* parent;
270 SkDOM::Node* child = parent->fFirstChild;
271 SkDOM::Node* prev = nullptr;
274 SkDOM::Node* next = child->fNextSibling;
302 SkTDArray<SkDOM::Node*> fParentStack;
304 SkDOM::Node* fRoot;
314 const SkDOM::Node* SkDOM::build(const char doc[], size_t len)
330 static void walk_dom(const SkDOM& dom, const SkDOM::Node* node, SkXMLParser* parser)
332 const char* elem = dom.getName(node);
333 if (dom.getType(node) == SkDOM::kText_Type) {
334 SkASSERT(dom.countChildren(node) == 0);
341 SkDOM::AttrIter iter(dom, node);
347 node = dom.getFirstChild(node, nullptr);
348 while (node)
350 walk_dom(dom, node, parser);
351 node = dom.getNextSibling(node, nullptr);
357 const SkDOM::Node* SkDOM::copy(const SkDOM& dom, const SkDOM::Node* node)
361 walk_dom(dom, node, &parser);
374 const SkDOM::Node* SkDOM::finishParsing() {
384 int SkDOM::countChildren(const Node* node, const char elem[]) const
388 node = this->getFirstChild(node, elem);
389 while (node)
392 node = this->getNextSibling(node, elem);
401 bool SkDOM::findS32(const Node* node, const char name[], int32_t* value) const
403 const char* vstr = this->findAttr(node, name);
407 bool SkDOM::findScalars(const Node* node, const char name[], SkScalar value[], int count) const
409 const char* vstr = this->findAttr(node, name);
413 bool SkDOM::findHex(const Node* node, const char name[], uint32_t* value) const
415 const char* vstr = this->findAttr(node, name);
419 bool SkDOM::findBool(const Node* node, const char name[], bool* value) const
421 const char* vstr = this->findAttr(node, name);
425 int SkDOM::findList(const Node* node, const char name[], const char list[]) const
427 const char* vstr = this->findAttr(node, name);
431 bool SkDOM::hasAttr(const Node* node, const char name[], const char value[]) const
433 const char* vstr = this->findAttr(node, name);
437 bool SkDOM::hasS32(const Node* node, const char name[], int32_t target) const
439 const char* vstr = this->findAttr(node, name);
444 bool SkDOM::hasScalar(const Node* node, const char name[], SkScalar target) const
446 const char* vstr = this->findAttr(node, name);
451 bool SkDOM::hasHex(const Node* node, const char name[], uint32_t target) const
453 const char* vstr = this->findAttr(node, name);
458 bool SkDOM::hasBool(const Node* node, const char name[], bool target) const
460 const char* vstr = this->findAttr(node, name);
469 void SkDOM::dump(const Node* node, int level) const
471 if (node == nullptr)
472 node = this->getRootNode();
476 xmlWriter.writeDOM(*this, node, false);
498 const Node* root = dom.build(gDoc, sizeof(gDoc) - 1);