• Home
  • Raw
  • Download

Lines Matching refs:root

86 inline std::string nameOf(NodeType *root) {  in nameOf()  argument
87 return root->Name() == NULL ? "" : root->Name(); in nameOf()
90 inline std::string getText(NodeType *root) { in getText() argument
91 return root->GetText() == NULL ? "" : root->GetText(); in getText()
112 inline bool getAttr(NodeType *root, const std::string &attrName, std::string *s) { in getAttr() argument
113 const char *c = root->Attribute(attrName.c_str()); in getAttr()
154 NodeType *root = createNode(this->elementName(), d); in serialize() local
155 this->mutateNode(o, root, d, flags); in serialize()
156 return root; in serialize()
165 inline bool deserialize(Object* object, NodeType* root) { in deserialize()
166 bool ret = deserialize(object, root, &mLastError); in deserialize()
173 inline bool deserialize(Object* object, NodeType* root, std::string* error) const { in deserialize()
174 if (nameOf(root) != this->elementName()) { in deserialize()
177 return this->buildObject(object, root, error); in deserialize()
247 inline bool parseOptionalAttr(NodeType* root, const std::string& attrName, T&& defaultValue, in parseOptionalAttr()
250 bool success = getAttr(root, attrName, &attrText) && in parseOptionalAttr()
259 inline bool parseAttr(NodeType* root, const std::string& attrName, T* attr, in parseAttr()
262 bool ret = getAttr(root, attrName, &attrText) && ::android::vintf::parse(attrText, attr); in parseAttr()
270 inline bool parseAttr(NodeType* root, const std::string& attrName, std::string* attr, in parseAttr()
272 bool ret = getAttr(root, attrName, attr); in parseAttr()
280 inline bool parseTextElement(NodeType* root, const std::string& elementName, std::string* s, in parseTextElement()
282 NodeType *child = getChild(root, elementName); in parseTextElement()
292 inline bool parseOptionalTextElement(NodeType* root, const std::string& elementName, in parseOptionalTextElement()
295 NodeType* child = getChild(root, elementName); in parseOptionalTextElement()
300 inline bool parseTextElements(NodeType* root, const std::string& elementName, in parseTextElements()
302 auto nodes = getChildren(root, elementName); in parseTextElements()
311 inline bool parseChild(NodeType* root, const XmlNodeConverter<T>& conv, T* t, in parseChild()
313 NodeType *child = getChild(root, conv.elementName()); in parseChild()
323 inline bool parseOptionalChild(NodeType* root, const XmlNodeConverter<T>& conv, in parseOptionalChild()
325 NodeType *child = getChild(root, conv.elementName()); in parseOptionalChild()
334 inline bool parseOptionalChild(NodeType* root, const XmlNodeConverter<T>& conv, in parseOptionalChild()
336 NodeType* child = getChild(root, conv.elementName()); in parseOptionalChild()
346 inline bool parseChildren(NodeType* root, const XmlNodeConverter<T>& conv, std::vector<T>* v, in parseChildren()
348 auto nodes = getChildren(root, conv.elementName()); in parseChildren()
362 inline bool parseChildren(NodeType* root, const XmlNodeConverter<T>& conv, Container* s, in parseChildren()
365 if (!parseChildren(root, conv, &vec, error)) { in parseChildren()
380 inline bool parseChildren(NodeType* root, const XmlNodeConverter<std::pair<K, V>>& conv, in parseChildren()
382 return parseChildren<std::map<K, V>, std::pair<K, V>>(root, conv, s, error); in parseChildren()
409 virtual void mutateNode(const Object &object, NodeType *root, DocType *d) const override { in mutateNode()
410 appendText(root, ::android::vintf::to_string(object), d); in mutateNode()
412 virtual bool buildObject(Object* object, NodeType* root, std::string* error) const override { in buildObject()
413 return this->parseText(root, object, error); in buildObject()
431 virtual void mutateNode(const Pair& pair, NodeType* root, DocType* d) const override { in mutateNode()
432 appendChild(root, mFirstConverter->serialize(pair.first, d)); in mutateNode()
433 appendChild(root, mSecondConverter->serialize(pair.second, d)); in mutateNode()
435 virtual bool buildObject(Pair* pair, NodeType* root, std::string* error) const override { in buildObject()
436 return this->parseChild(root, *mFirstConverter, &pair->first, error) && in buildObject()
437 this->parseChild(root, *mSecondConverter, &pair->second, error); in buildObject()
455 void mutateNode(const TransportArch &object, NodeType *root, DocType *d) const override { in mutateNode()
457 appendAttr(root, "arch", object.arch); in mutateNode()
459 appendText(root, ::android::vintf::to_string(object.transport), d); in mutateNode()
461 bool buildObject(TransportArch* object, NodeType* root, std::string* error) const override { in buildObject()
462 if (!parseOptionalAttr(root, "arch", Arch::ARCH_EMPTY, &object->arch, error) || in buildObject()
463 !parseText(root, &object->transport, error)) { in buildObject()
480 … void mutateNode(const KernelConfigTypedValue &object, NodeType *root, DocType *d) const override { in mutateNode()
481 appendAttr(root, "type", object.mType); in mutateNode()
482 appendText(root, ::android::vintf::to_string(object), d); in mutateNode()
484 bool buildObject(KernelConfigTypedValue* object, NodeType* root, in buildObject()
487 if (!parseAttr(root, "type", &object->mType, error) || in buildObject()
488 !parseText(root, &stringValue, error)) { in buildObject()
507 void mutateNode(const HalInterface &intf, NodeType *root, DocType *d) const override { in mutateNode()
508 appendTextElement(root, "name", intf.name(), d); in mutateNode()
509 appendTextElements(root, "instance", intf.mInstances, d); in mutateNode()
510 appendTextElements(root, "regex-instance", intf.mRegexes, d); in mutateNode()
512 bool buildObject(HalInterface* intf, NodeType* root, std::string* error) const override { in buildObject()
515 if (!parseTextElement(root, "name", &intf->mName, error) || in buildObject()
516 !parseTextElements(root, "instance", &instances, error) || in buildObject()
517 !parseTextElements(root, "regex-instance", &regexes, error)) { in buildObject()
549 void mutateNode(const MatrixHal &hal, NodeType *root, DocType *d) const override { in mutateNode()
550 appendAttr(root, "format", hal.format); in mutateNode()
551 appendAttr(root, "optional", hal.optional); in mutateNode()
552 appendTextElement(root, "name", hal.name, d); in mutateNode()
553 appendChildren(root, versionRangeConverter, hal.versionRanges, d); in mutateNode()
554 appendChildren(root, halInterfaceConverter, iterateValues(hal.interfaces), d); in mutateNode()
556 bool buildObject(MatrixHal* object, NodeType* root, std::string* error) const override { in buildObject()
558 if (!parseOptionalAttr(root, "format", HalFormat::HIDL, &object->format, error) || in buildObject()
559 !parseOptionalAttr(root, "optional", false /* defaultValue */, &object->optional, in buildObject()
561 !parseTextElement(root, "name", &object->name, error) || in buildObject()
562 !parseChildren(root, versionRangeConverter, &object->versionRanges, error) || in buildObject()
563 !parseChildren(root, halInterfaceConverter, &interfaces, error)) { in buildObject()
620 void mutateNode(const std::vector<KernelConfig>& conds, NodeType* root, in mutateNode()
622 appendChildren(root, matrixKernelConfigConverter, conds, d); in mutateNode()
624 bool buildObject(std::vector<KernelConfig>* object, NodeType* root, in buildObject()
626 return parseChildren(root, matrixKernelConfigConverter, object, error); in buildObject()
634 void mutateNode(const MatrixKernel& kernel, NodeType* root, DocType* d) const override { in mutateNode()
635 mutateNode(kernel, root, d, SerializeFlags::EVERYTHING); in mutateNode()
637 void mutateNode(const MatrixKernel& kernel, NodeType* root, DocType* d, in mutateNode()
643 appendAttr(root, "version", kv); in mutateNode()
646 appendChild(root, matrixKernelConditionsConverter(kernel.mConditions, d)); in mutateNode()
649 appendChildren(root, matrixKernelConfigConverter, kernel.mConfigs, d); in mutateNode()
652 bool buildObject(MatrixKernel* object, NodeType* root, std::string* error) const override { in buildObject()
653 if (!parseAttr(root, "version", &object->mMinLts, error) || in buildObject()
654 !parseOptionalChild(root, matrixKernelConditionsConverter, {}, &object->mConditions, in buildObject()
656 !parseChildren(root, matrixKernelConfigConverter, &object->mConfigs, error)) { in buildObject()
669 void mutateNode(const ManifestHal& m, NodeType* root, DocType* d) const override { in mutateNode()
670 mutateNode(m, root, d, SerializeFlags::EVERYTHING); in mutateNode()
672 void mutateNode(const ManifestHal& hal, NodeType* root, DocType* d, in mutateNode()
674 appendAttr(root, "format", hal.format); in mutateNode()
675 appendTextElement(root, "name", hal.name, d); in mutateNode()
676 appendChild(root, transportArchConverter(hal.transportArch, d)); in mutateNode()
677 appendChildren(root, versionConverter, hal.versions, d); in mutateNode()
678 appendChildren(root, halInterfaceConverter, iterateValues(hal.interfaces), d); in mutateNode()
680 appendAttr(root, "override", hal.isOverride()); in mutateNode()
689 appendChildren(root, fqInstanceConverter, fqInstances, d); in mutateNode()
692 bool buildObject(ManifestHal* object, NodeType* root, std::string* error) const override { in buildObject()
694 if (!parseOptionalAttr(root, "format", HalFormat::HIDL, &object->format, error) || in buildObject()
695 !parseOptionalAttr(root, "override", false, &object->mIsOverride, error) || in buildObject()
696 !parseTextElement(root, "name", &object->name, error) || in buildObject()
697 !parseOptionalChild(root, transportArchConverter, {}, &object->transportArch, error) || in buildObject()
698 !parseChildren(root, versionConverter, &object->versions, error) || in buildObject()
699 !parseChildren(root, halInterfaceConverter, &interfaces, error)) { in buildObject()
747 if (!parseChildren(root, fqInstanceConverter, &fqInstances, error)) { in buildObject()
791 void mutateNode(const Sepolicy &object, NodeType *root, DocType *d) const override { in mutateNode()
792 appendChild(root, kernelSepolicyVersionConverter(object.kernelSepolicyVersion(), d)); in mutateNode()
793 appendChildren(root, sepolicyVersionConverter, object.sepolicyVersions(), d); in mutateNode()
795 bool buildObject(Sepolicy* object, NodeType* root, std::string* error) const override { in buildObject()
796 if (!parseChild(root, kernelSepolicyVersionConverter, &object->mKernelSepolicyVersion, in buildObject()
798 !parseChildren(root, sepolicyVersionConverter, &object->mSepolicyVersionRanges, in buildObject()
814 void mutateNode(const Vndk &object, NodeType *root, DocType *d) const override { in mutateNode()
815 appendChild(root, vndkVersionRangeConverter(object.mVersionRange, d)); in mutateNode()
816 appendChildren(root, vndkLibraryConverter, object.mLibraries, d); in mutateNode()
818 bool buildObject(Vndk* object, NodeType* root, std::string* error) const override { in buildObject()
819 if (!parseChild(root, vndkVersionRangeConverter, &object->mVersionRange, error) || in buildObject()
820 !parseChildren(root, vndkLibraryConverter, &object->mLibraries, error)) { in buildObject()
831 void mutateNode(const VendorNdk& object, NodeType* root, DocType* d) const override { in mutateNode()
832 appendChild(root, vndkVersionConverter(object.mVersion, d)); in mutateNode()
833 appendChildren(root, vndkLibraryConverter, object.mLibraries, d); in mutateNode()
835 bool buildObject(VendorNdk* object, NodeType* root, std::string* error) const override { in buildObject()
836 if (!parseChild(root, vndkVersionConverter, &object->mVersion, error) || in buildObject()
837 !parseChildren(root, vndkLibraryConverter, &object->mLibraries, error)) { in buildObject()
850 void mutateNode(const SystemSdk& object, NodeType* root, DocType* d) const override { in mutateNode()
851 appendChildren(root, systemSdkVersionConverter, object.versions(), d); in mutateNode()
853 bool buildObject(SystemSdk* object, NodeType* root, std::string* error) const override { in buildObject()
854 return parseChildren(root, systemSdkVersionConverter, &object->mVersions, error); in buildObject()
862 void mutateNode(const Version &m, NodeType *root, DocType *d) const override { in mutateNode()
863 appendChild(root, versionConverter(m, d)); in mutateNode()
865 bool buildObject(Version* object, NodeType* root, std::string* error) const override { in buildObject()
866 return parseChild(root, versionConverter, object, error); in buildObject()
873 void mutateNode(const ManifestXmlFile& f, NodeType* root, DocType* d) const override { in mutateNode()
874 appendTextElement(root, "name", f.name(), d); in mutateNode()
875 appendChild(root, versionConverter(f.version(), d)); in mutateNode()
877 appendTextElement(root, "path", f.overriddenPath(), d); in mutateNode()
880 bool buildObject(ManifestXmlFile* object, NodeType* root, std::string* error) const override { in buildObject()
881 if (!parseTextElement(root, "name", &object->mName, error) || in buildObject()
882 !parseChild(root, versionConverter, &object->mVersion, error) || in buildObject()
883 !parseOptionalTextElement(root, "path", {}, &object->mOverriddenPath, error)) { in buildObject()
897 void mutateNode(const KernelInfo& o, NodeType* root, DocType* d) const override { in mutateNode()
898 mutateNode(o, root, d, SerializeFlags::EVERYTHING); in mutateNode()
900 void mutateNode(const KernelInfo& o, NodeType* root, DocType* d, in mutateNode()
903 appendAttr(root, "version", o.version()); in mutateNode()
906 appendChildren(root, kernelConfigConverter, o.configs(), d); in mutateNode()
909 bool buildObject(KernelInfo* o, NodeType* root, std::string* error) const override { in buildObject()
910 return parseOptionalAttr(root, "version", {}, &o->mVersion, error) && in buildObject()
911 parseChildren(root, kernelConfigConverter, &o->mConfigs, error); in buildObject()
919 void mutateNode(const HalManifest &m, NodeType *root, DocType *d) const override { in mutateNode()
920 mutateNode(m, root, d, SerializeFlags::EVERYTHING); in mutateNode()
922 void mutateNode(const HalManifest& m, NodeType* root, DocType* d, in mutateNode()
925 appendAttr(root, "version", m.getMetaVersion()); in mutateNode()
928 appendAttr(root, "type", m.mType); in mutateNode()
932 appendChildren(root, manifestHalConverter, m.getHals(), d, flags); in mutateNode()
937 appendChild(root, halManifestSepolicyConverter(m.device.mSepolicyVersion, d)); in mutateNode()
941 this->appendAttr(root, "target-level", m.mLevel); in mutateNode()
946 appendChild(root, kernelInfoConverter.serialize(*m.kernel(), d, flags)); in mutateNode()
953 appendChildren(root, vndkConverter, m.framework.mVndks, d); in mutateNode()
956 appendChildren(root, vendorNdkConverter, m.framework.mVendorNdks, d); in mutateNode()
960 appendChild(root, systemSdkConverter(m.framework.mSystemSdk, d)); in mutateNode()
966 appendChildren(root, manifestXmlFileConverter, m.getXmlFiles(), d); in mutateNode()
969 bool buildObject(HalManifest* object, NodeType* root, std::string* error) const override { in buildObject()
971 if (!parseAttr(root, "version", &object->mMetaVersion, error) || in buildObject()
972 !parseAttr(root, "type", &object->mType, error) || in buildObject()
973 !parseChildren(root, manifestHalConverter, &hals, error)) { in buildObject()
985 if (!parseOptionalChild(root, halManifestSepolicyConverter, {}, in buildObject()
990 if (!parseOptionalAttr(root, "target-level", Level::UNSPECIFIED, &object->mLevel, in buildObject()
995 if (!parseOptionalChild(root, kernelInfoConverter, &object->device.mKernel, error)) { in buildObject()
1001 if (!parseChildren(root, vndkConverter, &object->framework.mVndks, error)) { in buildObject()
1013 if (!parseChildren(root, vendorNdkConverter, &object->framework.mVendorNdks, error)) { in buildObject()
1026 if (!parseOptionalChild(root, systemSdkConverter, {}, &object->framework.mSystemSdk, in buildObject()
1040 if (!parseChildren(root, manifestXmlFileConverter, &xmlFiles, error)) { in buildObject()
1061 void mutateNode(const Version &m, NodeType *root, DocType *d) const override { in mutateNode()
1062 appendChild(root, avbVersionConverter(m, d)); in mutateNode()
1064 bool buildObject(Version* object, NodeType* root, std::string* error) const override { in buildObject()
1065 return parseChild(root, avbVersionConverter, object, error); in buildObject()
1072 void mutateNode(const MatrixXmlFile& f, NodeType* root, DocType* d) const override { in mutateNode()
1073 appendTextElement(root, "name", f.name(), d); in mutateNode()
1074 appendAttr(root, "format", f.format()); in mutateNode()
1075 appendAttr(root, "optional", f.optional()); in mutateNode()
1076 appendChild(root, versionRangeConverter(f.versionRange(), d)); in mutateNode()
1078 appendTextElement(root, "path", f.overriddenPath(), d); in mutateNode()
1081 bool buildObject(MatrixXmlFile* object, NodeType* root, std::string* error) const override { in buildObject()
1082 if (!parseTextElement(root, "name", &object->mName, error) || in buildObject()
1083 !parseAttr(root, "format", &object->mFormat, error) || in buildObject()
1084 !parseOptionalAttr(root, "optional", false, &object->mOptional, error) || in buildObject()
1085 !parseChild(root, versionRangeConverter, &object->mVersionRange, error) || in buildObject()
1086 !parseOptionalTextElement(root, "path", {}, &object->mOverriddenPath, error)) { in buildObject()
1096 void mutateNode(const CompatibilityMatrix &m, NodeType *root, DocType *d) const override { in mutateNode()
1097 mutateNode(m, root, d, SerializeFlags::EVERYTHING); in mutateNode()
1099 void mutateNode(const CompatibilityMatrix& m, NodeType* root, DocType* d, in mutateNode()
1102 appendAttr(root, "version", m.getMinimumMetaVersion()); in mutateNode()
1105 appendAttr(root, "type", m.mType); in mutateNode()
1109 appendChildren(root, matrixHalConverter, iterateValues(m.mHals), d); in mutateNode()
1113 appendChildren(root, matrixKernelConverter, m.framework.mKernels, d, flags); in mutateNode()
1117 appendChild(root, sepolicyConverter(m.framework.mSepolicy, d)); in mutateNode()
1122 appendChild(root, avbConverter(m.framework.mAvbMetaVersion, d)); in mutateNode()
1126 this->appendAttr(root, "level", m.mLevel); in mutateNode()
1133 appendChild(root, vndkConverter(m.device.mVndk, d)); in mutateNode()
1138 appendChild(root, vendorNdkConverter(m.device.mVendorNdk, d)); in mutateNode()
1144 appendChild(root, systemSdkConverter(m.device.mSystemSdk, d)); in mutateNode()
1150 appendChildren(root, matrixXmlFileConverter, m.getXmlFiles(), d); in mutateNode()
1153 bool buildObject(CompatibilityMatrix* object, NodeType* root, in buildObject()
1157 if (!parseAttr(root, "version", &version, error) || in buildObject()
1158 !parseAttr(root, "type", &object->mType, error) || in buildObject()
1159 !parseChildren(root, matrixHalConverter, &hals, error)) { in buildObject()
1166 if (!parseChildren(root, matrixKernelConverter, &object->framework.mKernels, error) || in buildObject()
1167 !parseOptionalChild(root, sepolicyConverter, {}, &object->framework.mSepolicy, in buildObject()
1169 !parseOptionalChild(root, avbConverter, {}, &object->framework.mAvbMetaVersion, in buildObject()
1188 if (!parseOptionalAttr(root, "level", Level::UNSPECIFIED, &object->mLevel, error)) { in buildObject()
1197 if (!parseOptionalChild(root, vndkConverter, {}, &object->device.mVndk, error)) { in buildObject()
1202 if (!parseOptionalChild(root, vendorNdkConverter, {}, &object->device.mVendorNdk, in buildObject()
1207 if (!parseOptionalChild(root, systemSdkConverter, {}, &object->device.mSystemSdk, in buildObject()
1226 if (!parseChildren(root, matrixXmlFileConverter, &xmlFiles, error)) { in buildObject()