From 5062351a0a2a95c3cbca27297b57afddc23d7a4f Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Wed, 4 Aug 2010 19:01:18 -0700 Subject: deprecated ADD_SORTED due to n^2 behavior, set the sort order on the scroll list instead --- indra/llcommon/stdenums.h | 4 ++-- indra/llui/llscrolllistctrl.cpp | 23 +++++----------------- indra/newview/llfloatergroups.cpp | 7 ++++--- indra/newview/llfloaterland.cpp | 4 ++-- indra/newview/llfloaterlandholdings.cpp | 9 ++++----- indra/newview/llfloatermediabrowser.cpp | 3 ++- indra/newview/llfloaterpreference.cpp | 6 ++---- indra/newview/llfloaterscriptlimits.cpp | 2 +- indra/newview/llpanelgroupgeneral.cpp | 2 +- indra/newview/llpanelgrouplandmoney.cpp | 2 +- indra/newview/llpanelgrouproles.cpp | 2 +- indra/newview/llpanellogin.cpp | 3 ++- indra/newview/llpanelprimmediacontrols.cpp | 2 +- .../default/xui/en/panel_group_land_money.xml | 2 ++ .../default/xui/en/panel_preferences_alerts.xml | 4 ++++ .../xui/en/panel_script_limits_region_memory.xml | 2 ++ 16 files changed, 36 insertions(+), 41 deletions(-) diff --git a/indra/llcommon/stdenums.h b/indra/llcommon/stdenums.h index 1a5678dde1..e0565204d4 100644 --- a/indra/llcommon/stdenums.h +++ b/indra/llcommon/stdenums.h @@ -119,8 +119,8 @@ enum EObjectPropertiesExtraID enum EAddPosition { ADD_TOP, - ADD_SORTED, - ADD_BOTTOM + ADD_BOTTOM, + ADD_DEFAULT }; enum LLGroupChange diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index d4d161f2c9..9ab2cfef4b 100644 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -541,23 +541,7 @@ BOOL LLScrollListCtrl::addItem( LLScrollListItem* item, EAddPosition pos, BOOL r setNeedsSort(); break; - case ADD_SORTED: - { - // sort by column 0, in ascending order - std::vector single_sort_column; - single_sort_column.push_back(std::make_pair(0, TRUE)); - - mItemList.push_back(item); - std::stable_sort( - mItemList.begin(), - mItemList.end(), - SortScrollListItem(single_sort_column,mSortCallback)); - - // ADD_SORTED just sorts by first column... - // this might not match user sort criteria, so flag list as being in unsorted state - setNeedsSort(); - break; - } + case ADD_DEFAULT: case ADD_BOTTOM: mItemList.push_back(item); setNeedsSort(); @@ -2762,9 +2746,10 @@ LLScrollListColumn* LLScrollListCtrl::getColumn(const std::string& name) return NULL; } - +LLFastTimer::DeclareTimer FTM_ADD_SCROLLLIST_ELEMENT("Add Scroll List Item"); LLScrollListItem* LLScrollListCtrl::addElement(const LLSD& element, EAddPosition pos, void* userdata) { + LLFastTimer _(FTM_ADD_SCROLLLIST_ELEMENT); LLScrollListItem::Params item_params; LLParamSDParser::instance().readSD(element, item_params); item_params.userdata = userdata; @@ -2773,12 +2758,14 @@ LLScrollListItem* LLScrollListCtrl::addElement(const LLSD& element, EAddPosition LLScrollListItem* LLScrollListCtrl::addRow(const LLScrollListItem::Params& item_p, EAddPosition pos) { + LLFastTimer _(FTM_ADD_SCROLLLIST_ELEMENT); LLScrollListItem *new_item = new LLScrollListItem(item_p); return addRow(new_item, item_p, pos); } LLScrollListItem* LLScrollListCtrl::addRow(LLScrollListItem *new_item, const LLScrollListItem::Params& item_p, EAddPosition pos) { + LLFastTimer _(FTM_ADD_SCROLLLIST_ELEMENT); if (!item_p.validateBlock() || !new_item) return NULL; new_item->setNumColumns(mColumns.size()); diff --git a/indra/newview/llfloatergroups.cpp b/indra/newview/llfloatergroups.cpp index 0bd8215e5c..8558345efa 100644 --- a/indra/newview/llfloatergroups.cpp +++ b/indra/newview/llfloatergroups.cpp @@ -347,11 +347,10 @@ void LLPanelGroups::onGroupList(LLUICtrl* ctrl, void* userdata) if(self) self->enableButtons(); } -void init_group_list(LLScrollListCtrl* ctrl, const LLUUID& highlight_id, U64 powers_mask) +void init_group_list(LLScrollListCtrl* group_list, const LLUUID& highlight_id, U64 powers_mask) { S32 count = gAgent.mGroups.count(); LLUUID id; - LLCtrlListInterface *group_list = ctrl->getListInterface(); if (!group_list) return; group_list->operateOnAll(LLCtrlListInterface::OP_DELETE); @@ -375,10 +374,12 @@ void init_group_list(LLScrollListCtrl* ctrl, const LLUUID& highlight_id, U64 pow element["columns"][0]["font"]["name"] = "SANSSERIF"; element["columns"][0]["font"]["style"] = style; - group_list->addElement(element, ADD_SORTED); + group_list->addElement(element); } } + group_list->sortOnce(0, TRUE); + // add "none" to list at top { std::string style = "NORMAL"; diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 625b443abc..19e28720ae 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -2440,7 +2440,7 @@ void LLPanelLandAccess::refresh() suffix.append(" " + parent_floater->getString("Remaining") + ")"); } if (mListAccess) - mListAccess->addNameItem(entry.mID, ADD_SORTED, TRUE, suffix); + mListAccess->addNameItem(entry.mID, ADD_DEFAULT, TRUE, suffix); } } @@ -2481,7 +2481,7 @@ void LLPanelLandAccess::refresh() } suffix.append(" " + parent_floater->getString("Remaining") + ")"); } - mListBanned->addNameItem(entry.mID, ADD_SORTED, TRUE, suffix); + mListBanned->addNameItem(entry.mID, ADD_DEFAULT, TRUE, suffix); } } diff --git a/indra/newview/llfloaterlandholdings.cpp b/indra/newview/llfloaterlandholdings.cpp index 3c8ee6eb9e..12d27b8790 100644 --- a/indra/newview/llfloaterlandholdings.cpp +++ b/indra/newview/llfloaterlandholdings.cpp @@ -75,10 +75,9 @@ BOOL LLFloaterLandHoldings::postBuild() childSetAction("Show on Map", onClickMap, this); // Grant list - getChild("grant list")->setDoubleClickCallback(onGrantList, this); - - LLCtrlListInterface *list = childGetListInterface("grant list"); - if (!list) return TRUE; + LLScrollListCtrl* grant_list = getChild("grant list"); + grant_list->sortByColumnIndex(0, TRUE); + grant_list->setDoubleClickCallback(onGrantList, this); S32 count = gAgent.mGroups.count(); for(S32 i = 0; i < count; ++i) @@ -97,7 +96,7 @@ BOOL LLFloaterLandHoldings::postBuild() element["columns"][1]["value"] = areastr; element["columns"][1]["font"] = "SANSSERIF"; - list->addElement(element, ADD_SORTED); + grant_list->addElement(element); } center(); diff --git a/indra/newview/llfloatermediabrowser.cpp b/indra/newview/llfloatermediabrowser.cpp index 5405de2f9a..d01488b6b1 100644 --- a/indra/newview/llfloatermediabrowser.cpp +++ b/indra/newview/llfloatermediabrowser.cpp @@ -105,6 +105,7 @@ BOOL LLFloaterMediaBrowser::postBuild() mAddressCombo = getChild("address"); mAddressCombo->setCommitCallback(onEnterAddress, this); + mAddressCombo->sortByName(); childSetAction("back", onClickBack, this); childSetAction("forward", onClickForward, this); @@ -185,7 +186,7 @@ void LLFloaterMediaBrowser::setCurrentURL(const std::string& url) if (mCurrentURL != "about:blank") { mAddressCombo->remove(mCurrentURL); - mAddressCombo->add(mCurrentURL, ADD_SORTED); + mAddressCombo->add(mCurrentURL); mAddressCombo->selectByValue(mCurrentURL); // Serialize url history diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 7791c037d3..a4b45e04f2 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -826,13 +826,11 @@ void LLFloaterPreference::buildPopupLists() row["columns"][1]["font"] = "SANSSERIF_SMALL"; row["columns"][1]["width"] = 360; } - item = disabled_popups.addElement(row, - ADD_SORTED); + item = disabled_popups.addElement(row); } else { - item = enabled_popups.addElement(row, - ADD_SORTED); + item = enabled_popups.addElement(row); } if (item) diff --git a/indra/newview/llfloaterscriptlimits.cpp b/indra/newview/llfloaterscriptlimits.cpp index e0f646349e..e827e19f82 100644 --- a/indra/newview/llfloaterscriptlimits.cpp +++ b/indra/newview/llfloaterscriptlimits.cpp @@ -741,7 +741,7 @@ void LLPanelScriptLimitsRegionMemory::setRegionDetails(LLSD content) } element["columns"][5]["font"] = "SANSSERIF"; - list->addElement(element, ADD_SORTED); + list->addElement(element); element["owner_id"] = owner_id; element["local_id"] = local_id; diff --git a/indra/newview/llpanelgroupgeneral.cpp b/indra/newview/llpanelgroupgeneral.cpp index 2302772803..155e000bb8 100644 --- a/indra/newview/llpanelgroupgeneral.cpp +++ b/indra/newview/llpanelgroupgeneral.cpp @@ -746,7 +746,7 @@ void LLPanelGroupGeneral::updateMembers() sSDTime += sd_timer.getElapsedTimeF32(); element_timer.reset(); - LLScrollListItem* member_row = mListVisibleMembers->addElement(row);//, ADD_SORTED); + LLScrollListItem* member_row = mListVisibleMembers->addElement(row); if ( member->isOwner() ) { diff --git a/indra/newview/llpanelgrouplandmoney.cpp b/indra/newview/llpanelgrouplandmoney.cpp index 1404cfcea2..16d5f8140d 100644 --- a/indra/newview/llpanelgrouplandmoney.cpp +++ b/indra/newview/llpanelgrouplandmoney.cpp @@ -528,7 +528,7 @@ void LLPanelGroupLandMoney::impl::processGroupLand(LLMessageSystem* msg) row["columns"][4]["column"] = "hidden"; row["columns"][4]["value"] = hidden; - mGroupParcelsp->addElement(row, ADD_SORTED); + mGroupParcelsp->addElement(row); } } } diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp index 7a28d10baf..efc797cfe9 100644 --- a/indra/newview/llpanelgrouproles.cpp +++ b/indra/newview/llpanelgrouproles.cpp @@ -1631,7 +1631,7 @@ void LLPanelGroupMembersSubTab::updateMembers() row["columns"][2]["value"] = mMemberProgress->second->getOnlineStatus(); row["columns"][2]["font"] = "SANSSERIF_SMALL"; - LLScrollListItem* member = mMembersList->addElement(row);//, ADD_SORTED); + LLScrollListItem* member = mMembersList->addElement(row); LLUUID id = member->getUUID(); mHasMatch = TRUE; diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 4b23e63f12..58ed01896a 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -1110,9 +1110,10 @@ void LLPanelLogin::updateServerCombo() { if (!grid_choice->first.empty()) { - server_choice_combo->add(grid_choice->second, grid_choice->first, ADD_SORTED); + server_choice_combo->add(grid_choice->second, grid_choice->first); } } + server_choice_combo->sortByName(); server_choice_combo->addSeparator(ADD_TOP); diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp index 0648d99685..81e805974f 100644 --- a/indra/newview/llpanelprimmediacontrols.cpp +++ b/indra/newview/llpanelprimmediacontrols.cpp @@ -1171,7 +1171,7 @@ void LLPanelPrimMediaControls::setCurrentURL() // if (media_address_combo && mCurrentURL != "about:blank") // { // media_address_combo->remove(mCurrentURL); -// media_address_combo->add(mCurrentURL, ADD_SORTED); +// media_address_combo->add(mCurrentURL); // media_address_combo->selectByValue(mCurrentURL); // } #else // USE_COMBO_BOX_FOR_MEDIA_URL diff --git a/indra/newview/skins/default/xui/en/panel_group_land_money.xml b/indra/newview/skins/default/xui/en/panel_group_land_money.xml index 76f7484c68..1e1d2d18ca 100644 --- a/indra/newview/skins/default/xui/en/panel_group_land_money.xml +++ b/indra/newview/skins/default/xui/en/panel_group_land_money.xml @@ -60,6 +60,8 @@ left="0" right="-1" top="0" + sort_column="0" + sort_ascending="true" name="group_parcel_list" width="313"> will interpret as "button.rect" + // since there is no widget named "rect" + if (child_name.find(".") == std::string::npos) + { + mNameStack.push_back(std::make_pair(child_name, newParseGeneration())); + num_tokens_pushed++; + } + else + { + // parse out "dotted" name into individual tokens + tokenizer name_tokens(child_name, sep); + + tokenizer::iterator name_token_it = name_tokens.begin(); + if(name_token_it == name_tokens.end()) + { + return; + } + + // check for proper nesting + if(!mScope.empty() && *name_token_it != mScope.back()) + { + return; + } + + // now ignore first token + ++name_token_it; + + // copy remaining tokens on to our running token list + for(tokenizer::iterator token_to_push = name_token_it; token_to_push != name_tokens.end(); ++token_to_push) + { + mNameStack.push_back(std::make_pair(*token_to_push, newParseGeneration())); + num_tokens_pushed++; + } + mScope.push_back(mNameStack.back().first); + } + } + else + { + mScope.push_back(name); + } + + mTokenSizeStack.push_back(num_tokens_pushed); + readAttributes(atts); +} + +bool LLFastXUIParser::readAttributes(const char **atts) +{ + typedef boost::tokenizer > tokenizer; + boost::char_separator sep("."); + + bool any_parsed = false; + for(S32 i = 0; atts[i] && atts[i+1]; i += 2 ) + { + std::string attribute_name(atts[i]); + mCurAttributeValueBegin = atts[i+1]; + + S32 num_tokens_pushed = 0; + tokenizer name_tokens(attribute_name, sep); + // copy remaining tokens on to our running token list + for(tokenizer::iterator token_to_push = name_tokens.begin(); token_to_push != name_tokens.end(); ++token_to_push) + { + mNameStack.push_back(std::make_pair(*token_to_push, newParseGeneration())); + num_tokens_pushed++; + } + + // child nodes are not necessarily valid attributes, so don't complain once we've recursed + bool silent = mCurReadDepth > 1; + any_parsed |= mBlock->submitValue(mNameStack, *this, silent); + + while(num_tokens_pushed-- > 0) + { + mNameStack.pop_back(); + } + } + return any_parsed; +} + + +void LLFastXUIParser::endElement(const char *name) +{ + mCurReadDepth--; + S32 num_tokens_to_pop = mTokenSizeStack.back(); + mTokenSizeStack.pop_back(); + while(num_tokens_to_pop-- > 0) + { + mNameStack.pop_back(); + } + mScope.pop_back(); +} + +void LLFastXUIParser::characterData(const char *s, int len) +{ +} + + +/*virtual*/ std::string LLFastXUIParser::getCurrentElementName() +{ + std::string full_name; + for (name_stack_t::iterator it = mNameStack.begin(); + it != mNameStack.end(); + ++it) + { + full_name += it->first + "."; // build up dotted names: "button.param.nestedparam." + } + + return full_name; +} + +const S32 LINE_NUMBER_HERE = 0; + +void LLFastXUIParser::parserWarning(const std::string& message) +{ +#ifdef LL_WINDOWS + // use Visual Studo friendly formatting of output message for easy access to originating xml + llutf16string utf16str = utf8str_to_utf16str(llformat("%s(%d):\t%s", mCurFileName.c_str(), LINE_NUMBER_HERE, message.c_str()).c_str()); + utf16str += '\n'; + OutputDebugString(utf16str.c_str()); +#else + Parser::parserWarning(message); +#endif +} + +void LLFastXUIParser::parserError(const std::string& message) +{ +#ifdef LL_WINDOWS + llutf16string utf16str = utf8str_to_utf16str(llformat("%s(%d):\t%s", mCurFileName.c_str(), LINE_NUMBER_HERE, message.c_str()).c_str()); + utf16str += '\n'; + OutputDebugString(utf16str.c_str()); +#else + Parser::parserError(message); +#endif +} + +bool LLFastXUIParser::readBoolValue(Parser& parser, void* val_ptr) +{ + LLFastXUIParser& self = static_cast(parser); + if (!strcmp(self.mCurAttributeValueBegin, "true")) + { + *((bool*)val_ptr) = true; + return true; + } + else if (!strcmp(self.mCurAttributeValueBegin, "false")) + { + *((bool*)val_ptr) = false; + return true; + } + + return false; +} + +bool LLFastXUIParser::readStringValue(Parser& parser, void* val_ptr) +{ + LLFastXUIParser& self = static_cast(parser); + *((std::string*)val_ptr) = self.mCurAttributeValueBegin; + return true; +} + +bool LLFastXUIParser::readU8Value(Parser& parser, void* val_ptr) +{ + LLFastXUIParser& self = static_cast(parser); + return parse(self.mCurAttributeValueBegin, uint_p[assign_a(*(U8*)val_ptr)]).full; +} + +bool LLFastXUIParser::readS8Value(Parser& parser, void* val_ptr) +{ + LLFastXUIParser& self = static_cast(parser); + return parse(self.mCurAttributeValueBegin, int_p[assign_a(*(S8*)val_ptr)]).full; +} + +bool LLFastXUIParser::readU16Value(Parser& parser, void* val_ptr) +{ + LLFastXUIParser& self = static_cast(parser); + return parse(self.mCurAttributeValueBegin, uint_p[assign_a(*(U16*)val_ptr)]).full; +} + +bool LLFastXUIParser::readS16Value(Parser& parser, void* val_ptr) +{ + LLFastXUIParser& self = static_cast(parser); + return parse(self.mCurAttributeValueBegin, int_p[assign_a(*(S16*)val_ptr)]).full; +} + +bool LLFastXUIParser::readU32Value(Parser& parser, void* val_ptr) +{ + LLFastXUIParser& self = static_cast(parser); + return parse(self.mCurAttributeValueBegin, uint_p[assign_a(*(U32*)val_ptr)]).full; +} + +bool LLFastXUIParser::readS32Value(Parser& parser, void* val_ptr) +{ + LLFastXUIParser& self = static_cast(parser); + return parse(self.mCurAttributeValueBegin, int_p[assign_a(*(S32*)val_ptr)]).full; +} + +bool LLFastXUIParser::readF32Value(Parser& parser, void* val_ptr) +{ + LLFastXUIParser& self = static_cast(parser); + return parse(self.mCurAttributeValueBegin, real_p[assign_a(*(F32*)val_ptr)]).full; +} + +bool LLFastXUIParser::readF64Value(Parser& parser, void* val_ptr) +{ + LLFastXUIParser& self = static_cast(parser); + return parse(self.mCurAttributeValueBegin, real_p[assign_a(*(F64*)val_ptr)]).full; +} + +bool LLFastXUIParser::readColor4Value(Parser& parser, void* val_ptr) +{ + LLFastXUIParser& self = static_cast(parser); + LLColor4 value; + + if (parse(self.mCurAttributeValueBegin, real_p[assign_a(value.mV[0])] >> real_p[assign_a(value.mV[1])] >> real_p[assign_a(value.mV[2])] >> real_p[assign_a(value.mV[3])], space_p).full) + { + *(LLColor4*)(val_ptr) = value; + return true; + } + return false; +} + +bool LLFastXUIParser::readUIColorValue(Parser& parser, void* val_ptr) +{ + LLFastXUIParser& self = static_cast(parser); + LLColor4 value; + LLUIColor* colorp = (LLUIColor*)val_ptr; + + if (parse(self.mCurAttributeValueBegin, real_p[assign_a(value.mV[0])] >> real_p[assign_a(value.mV[1])] >> real_p[assign_a(value.mV[2])] >> real_p[assign_a(value.mV[3])], space_p).full) + { + colorp->set(value); + return true; + } + return false; +} + +bool LLFastXUIParser::readUUIDValue(Parser& parser, void* val_ptr) +{ + LLFastXUIParser& self = static_cast(parser); + LLUUID temp_id; + // LLUUID::set is destructive, so use temporary value + if (temp_id.set(self.mCurAttributeValueBegin)) + { + *(LLUUID*)(val_ptr) = temp_id; + return true; + } + return false; +} + +bool LLFastXUIParser::readSDValue(Parser& parser, void* val_ptr) +{ + LLFastXUIParser& self = static_cast(parser); + *((LLSD*)val_ptr) = LLSD(self.mCurAttributeValueBegin); + return true; +} \ No newline at end of file diff --git a/indra/llxuixml/llxuiparser.h b/indra/llxuixml/llxuiparser.h index 884f4f7578..4deb083e1c 100644 --- a/indra/llxuixml/llxuiparser.h +++ b/indra/llxuixml/llxuiparser.h @@ -120,26 +120,24 @@ public: void writeXUI(LLXMLNodePtr node, const LLInitParam::BaseBlock& block, const LLInitParam::BaseBlock* diff_block = NULL); private: - typedef std::list > token_list_t; - bool readXUIImpl(LLXMLNodePtr node, const std::string& scope, LLInitParam::BaseBlock& block); bool readAttributes(LLXMLNodePtr nodep, LLInitParam::BaseBlock& block); //reader helper functions - bool readBoolValue(void* val_ptr); - bool readStringValue(void* val_ptr); - bool readU8Value(void* val_ptr); - bool readS8Value(void* val_ptr); - bool readU16Value(void* val_ptr); - bool readS16Value(void* val_ptr); - bool readU32Value(void* val_ptr); - bool readS32Value(void* val_ptr); - bool readF32Value(void* val_ptr); - bool readF64Value(void* val_ptr); - bool readColor4Value(void* val_ptr); - bool readUIColorValue(void* val_ptr); - bool readUUIDValue(void* val_ptr); - bool readSDValue(void* val_ptr); + static bool readBoolValue(Parser& parser, void* val_ptr); + static bool readStringValue(Parser& parser, void* val_ptr); + static bool readU8Value(Parser& parser, void* val_ptr); + static bool readS8Value(Parser& parser, void* val_ptr); + static bool readU16Value(Parser& parser, void* val_ptr); + static bool readS16Value(Parser& parser, void* val_ptr); + static bool readU32Value(Parser& parser, void* val_ptr); + static bool readS32Value(Parser& parser, void* val_ptr); + static bool readF32Value(Parser& parser, void* val_ptr); + static bool readF64Value(Parser& parser, void* val_ptr); + static bool readColor4Value(Parser& parser, void* val_ptr); + static bool readUIColorValue(Parser& parser, void* val_ptr); + static bool readUUIDValue(Parser& parser, void* val_ptr); + static bool readSDValue(Parser& parser, void* val_ptr); //writer helper functions bool writeBoolValue(const void* val_ptr, const name_stack_t&); @@ -173,5 +171,61 @@ private: std::string mCurFileName; }; +class LLFastXUIParser : public LLInitParam::Parser, public LLSingleton +{ +LOG_CLASS(LLFastXUIParser); + +protected: + LLFastXUIParser(); + virtual ~LLFastXUIParser(); + friend class LLSingleton; +public: + typedef LLInitParam::Parser::name_stack_t name_stack_t; + + /*virtual*/ std::string getCurrentElementName(); + /*virtual*/ void parserWarning(const std::string& message); + /*virtual*/ void parserError(const std::string& message); + + bool readXUI(const std::string& filename, LLInitParam::BaseBlock& block, bool silent=false); + +private: + //reader helper functions + static bool readBoolValue(Parser&, void* val_ptr); + static bool readStringValue(Parser&, void* val_ptr); + static bool readU8Value(Parser&, void* val_ptr); + static bool readS8Value(Parser&, void* val_ptr); + static bool readU16Value(Parser&, void* val_ptr); + static bool readS16Value(Parser&, void* val_ptr); + static bool readU32Value(Parser&, void* val_ptr); + static bool readS32Value(Parser&, void* val_ptr); + static bool readF32Value(Parser&, void* val_ptr); + static bool readF64Value(Parser&, void* val_ptr); + static bool readColor4Value(Parser&, void* val_ptr); + static bool readUIColorValue(Parser&, void* val_ptr); + static bool readUUIDValue(Parser&, void* val_ptr); + static bool readSDValue(Parser&, void* val_ptr); + +private: + static void startElementHandler(void *userData, const char *name, const char **atts); + static void endElementHandler(void *userData, const char *name); + static void characterDataHandler(void *userData, const char *s, int len); + + void startElement(const char *name, const char **atts); + void endElement(const char *name); + void characterData(const char *s, int len); + bool readAttributes(const char **atts); + + LLInitParam::BaseBlock* mBlock; + Parser::name_stack_t mNameStack; + struct XML_ParserStruct* mParser; + S32 mLastWriteGeneration; + LLXMLNodePtr mLastWrittenChild; + S32 mCurReadDepth; + std::string mCurFileName; + const char* mCurAttributeValueBegin; + std::vector mTokenSizeStack; + std::vector mScope; +}; + #endif //LLXUIPARSER_H -- cgit v1.2.3 From 52936c4ffe97172a5d4926e252f2a25515c47895 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 5 Aug 2010 13:15:22 -0700 Subject: reverted unportable use of typeinfo* as hash key --- indra/llxuixml/llinitparam.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/indra/llxuixml/llinitparam.h b/indra/llxuixml/llinitparam.h index 1cc7d06b73..9890bacea4 100644 --- a/indra/llxuixml/llinitparam.h +++ b/indra/llxuixml/llinitparam.h @@ -207,9 +207,9 @@ namespace LLInitParam typedef boost::function parser_write_func_t; typedef boost::function parser_inspect_func_t; - typedef boost::unordered_map parser_read_func_map_t; - typedef boost::unordered_map parser_write_func_map_t; - typedef boost::unordered_map parser_inspect_func_map_t; + typedef std::map parser_read_func_map_t; + typedef std::map parser_write_func_map_t; + typedef std::map parser_inspect_func_map_t; Parser() : mParseSilently(false), -- cgit v1.2.3