/* const irr::c8 *CXMLRegistry::getValueAsCharCStr(const wchar_t *index, const wchar_t *context) { irr::core::stringc temp; temp = getValueAsCStr(index,context); return (const irr::c8 *)temp.c_str(); } */ const wchar_t *CXMLRegistry::getValueAsCStr(const wchar_t *index, const wchar_t *context) { CXMLNode *targetNode; targetNode = resolveContext(context); if(!targetNode) return 0; targetNode = targetNode->findChildByName(index); if(!targetNode) return 0; return targetNode->getValue(); }
bool CXMLRegistry::setValue(const wchar_t *index, const wchar_t * txtval, const wchar_t *context) { CXMLNode *targetNode; targetNode = resolveContext(context); if(!targetNode) return false; targetNode = targetNode->findChildByName(index); if(!targetNode) return false; targetNode->setValue(txtval); return true; }
bool CXMLRegistry::populateTreeView(irr::gui::IGUITreeView *control, const wchar_t *context) { CXMLNode *targetNode = NULL; if(context == 0) targetNode = registry; else targetNode = resolveContext(context); if(!targetNode) return false; targetNode->populateTreeView(control->getRoot()); return true; }
// Made more robust irr::video::SColor CXMLRegistry::getValueAsColor(const wchar_t *context) { CXMLNode *targetNode = resolveContext(context); if(!targetNode) return NULL; irr::u32 r,g,b,a; irr::core::stringw tmp; tmp = targetNode->findChildByName(L"r")->getValue(); if(tmp.size()) r = _wtoi(tmp.c_str()); tmp = targetNode->findChildByName(L"g")->getValue(); if(tmp.size()) g = _wtoi(tmp.c_str()); tmp = targetNode->findChildByName(L"b")->getValue(); if(tmp.size()) b = _wtoi(tmp.c_str()); tmp = targetNode->findChildByName(L"a")->getValue(); if(tmp.size()) a = _wtoi(tmp.c_str()); return irr::video::SColor(a,r,g,b); }
irr::core::rect<u32> CXMLRegistry::getValueAsRect(const wchar_t *context) { CXMLNode *targetNode = resolveContext(context); irr::u32 tx,ty,bx,by; if(!targetNode) return irr::core::rect<u32>(0,0,0,0); tx = _wtoi(targetNode->findChildByName(L"tlx")->getValue()); ty = _wtoi(targetNode->findChildByName(L"tly")->getValue()); bx = _wtoi(targetNode->findChildByName(L"brx")->getValue()); by = _wtoi(targetNode->findChildByName(L"bry")->getValue()); // Hrm what to return on err, cant return null, 0,0,0,0 might be a real loc // Its u32, maby some HUGE value? maxint? // Still takes out a value but its less likely if(!tx || !ty || !bx || !by) return irr::core::rect<u32>(0,0,0,0); else return irr::core::rect<u32>(tx,ty,bx,by); }
core::array<const wchar_t*>* CXMLRegistry::listNodeChildren(const wchar_t *node,const wchar_t *context) { CXMLNode *targetNode; targetNode = resolveContext(context); if(!targetNode) return 0; return targetNode->listNodeChildren(); }
void CXMLRegistry::setContext(const wchar_t *context) { currentContext = resolveContext(context); }
void Struct_Class::resolveMethodReferences(const ResolveContext &context) { constantPoolTable.resolveMethodReferences(resolveContext(context)); }
void Struct_Class::resolveClassReferences(ResolveContext const &context) { constantPoolTable.resolveClassReferences(resolveContext(context)); }