void DBOptionsAttributes::SetFromNode(DataNode *parentNode) { if(parentNode == 0) return; DataNode *searchNode = parentNode->GetNode("DBOptionsAttributes"); if(searchNode == 0) return; DataNode *node; if((node = searchNode->GetNode("types")) != 0) SetTypes(node->AsIntVector()); if((node = searchNode->GetNode("names")) != 0) SetNames(node->AsStringVector()); if((node = searchNode->GetNode("optBools")) != 0) SetOptBools(node->AsIntVector()); if((node = searchNode->GetNode("optFloats")) != 0) SetOptFloats(node->AsDoubleVector()); if((node = searchNode->GetNode("optDoubles")) != 0) SetOptDoubles(node->AsDoubleVector()); if((node = searchNode->GetNode("optInts")) != 0) SetOptInts(node->AsIntVector()); if((node = searchNode->GetNode("optStrings")) != 0) SetOptStrings(node->AsStringVector()); if((node = searchNode->GetNode("optEnums")) != 0) SetOptEnums(node->AsIntVector()); if((node = searchNode->GetNode("enumStrings")) != 0) SetEnumStrings(node->AsStringVector()); if((node = searchNode->GetNode("enumStringsSizes")) != 0) SetEnumStringsSizes(node->AsIntVector()); if((node = searchNode->GetNode("obsoleteNames")) != 0) SetObsoleteNames(node->AsStringVector()); }
void DBPluginInfoAttributes::SetFromNode(DataNode *parentNode) { if(parentNode == 0) return; DataNode *searchNode = parentNode->GetNode("DBPluginInfoAttributes"); if(searchNode == 0) return; DataNode *node; DataNode **children; if((node = searchNode->GetNode("types")) != 0) SetTypes(node->AsStringVector()); if((node = searchNode->GetNode("hasWriter")) != 0) SetHasWriter(node->AsIntVector()); // Clear all the DBOptionsAttributess if we got any. bool clearedDbReadOptions = false; // Go through all of the children and construct a new // DBOptionsAttributes for each one of them. children = searchNode->GetChildren(); if(children != 0) { for(int i = 0; i < searchNode->GetNumChildren(); ++i) { if(children[i]->GetKey() == std::string("DBOptionsAttributes")) { if (!clearedDbReadOptions) { ClearDbReadOptions(); clearedDbReadOptions = true; } DBOptionsAttributes temp; temp.SetFromNode(children[i]); AddDbReadOptions(temp); } } } // Clear all the DBOptionsAttributess if we got any. bool clearedDbWriteOptions = false; // Go through all of the children and construct a new // DBOptionsAttributes for each one of them. children = searchNode->GetChildren(); if(children != 0) { for(int i = 0; i < searchNode->GetNumChildren(); ++i) { if(children[i]->GetKey() == std::string("DBOptionsAttributes")) { if (!clearedDbWriteOptions) { ClearDbWriteOptions(); clearedDbWriteOptions = true; } DBOptionsAttributes temp; temp.SetFromNode(children[i]); AddDbWriteOptions(temp); } } } if((node = searchNode->GetNode("typesFullNames")) != 0) SetTypesFullNames(node->AsStringVector()); if((node = searchNode->GetNode("license")) != 0) SetLicense(node->AsStringVector()); if((node = searchNode->GetNode("host")) != 0) SetHost(node->AsString()); }