From 73b6bee4214e6287d67aae75778206c09c961f48 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 5 Jun 2011 17:52:40 +0200 Subject: [PATCH] Changed: Replaced NLMISC::strlwr by NLMISC::toLower --- .../src/interface_v3/action_handler.cpp | 4 +-- .../src/interface_v3/bot_chat_page_trade.cpp | 2 +- .../client/src/interface_v3/ctrl_base.cpp | 3 +- .../src/interface_v3/ctrl_base_button.cpp | 9 ++---- .../src/interface_v3/interface_options.cpp | 2 +- .../client/src/string_manager_client.cpp | 3 +- .../server/src/ai_service/ai_grp_npc.cpp | 2 +- .../src/ai_service/ai_outpost_actions.cpp | 2 +- .../server/src/ai_service/continent_inline.h | 2 +- .../src/server_share/continent_container.cpp | 12 +++---- .../mission_compiler_lib/mission_compiler.cpp | 16 +++++----- .../mission_compiler_lib/step_content.cpp | 14 ++++---- .../tools/leveldesign/prim_export/main.cpp | 10 +++--- .../tools/make_anim_melee_impact/main.cpp | 6 ++-- .../tools/patch_gen/patch_gen_common.cpp | 4 +-- code/ryzom/tools/pd_parser/parser.cpp | 32 +++++++++---------- .../server/build_world_packed_col/village.cpp | 2 +- 17 files changed, 59 insertions(+), 66 deletions(-) diff --git a/code/ryzom/client/src/interface_v3/action_handler.cpp b/code/ryzom/client/src/interface_v3/action_handler.cpp index 529c7f1c2..242543531 100644 --- a/code/ryzom/client/src/interface_v3/action_handler.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler.cpp @@ -77,7 +77,7 @@ std::string IActionHandler::getParam (const string &Params, const string &ParamN std::string::size_type e = allparam.find('='); if (e == std::string::npos || e == 0) break; std::string::size_type p = allparam.find('|'); - string tmp = strlwr(allparam.substr(0,e)); + string tmp = NLMISC::toLower(allparam.substr(0,e)); skipBlankAtEnd(tmp); if (tmp == param) { @@ -103,7 +103,7 @@ void IActionHandler::getAllParams (const string &Params, vector< pairgetDefine(toString("faction_icon_%s", factionName.c_str())); CViewBitmap *vBmp= dynamic_cast(fpGroup->getView("unit_price:item_price:icone")); if(vBmp) vBmp->setTexture(factionIcon); diff --git a/code/ryzom/client/src/interface_v3/ctrl_base.cpp b/code/ryzom/client/src/interface_v3/ctrl_base.cpp index 85414ba6e..0e35d2eb8 100644 --- a/code/ryzom/client/src/interface_v3/ctrl_base.cpp +++ b/code/ryzom/client/src/interface_v3/ctrl_base.cpp @@ -92,8 +92,7 @@ bool CCtrlBase::parse (xmlNodePtr cur, CInterfaceGroup *parentGroup) prop = (char*) xmlGetProp( cur, (xmlChar*)"on_tooltip" ); if (prop) { - _OnContextHelp= (const char*)prop; - NLMISC::strlwr(_OnContextHelp); + _OnContextHelp= NLMISC::toLower(std::string((const char*)prop)); } prop = (char*) xmlGetProp( cur, (xmlChar*)"on_tooltip_params" ); if (prop) diff --git a/code/ryzom/client/src/interface_v3/ctrl_base_button.cpp b/code/ryzom/client/src/interface_v3/ctrl_base_button.cpp index a25bbf56d..b2f03b98b 100644 --- a/code/ryzom/client/src/interface_v3/ctrl_base_button.cpp +++ b/code/ryzom/client/src/interface_v3/ctrl_base_button.cpp @@ -160,21 +160,18 @@ bool CCtrlBaseButton::parse (xmlNodePtr cur,CInterfaceGroup * parentGroup) prop = (char*) xmlGetProp( cur, (xmlChar*)"menu_l" ); if (prop) { - string tmp = (const char *) prop; - _ListMenuLeft = strlwr(tmp); + _ListMenuLeft = NLMISC::toLower(std::string((const char *) prop)); } prop = (char*) xmlGetProp( cur, (xmlChar*)"menu_r" ); if (prop) { - string tmp = (const char *) prop; - _ListMenuRight = strlwr(tmp); + _ListMenuRight = NLMISC::toLower(std::string((const char *) prop)); } // list menu on both clicks prop = (char*) xmlGetProp( cur, (xmlChar*)"menu_b" ); if (prop) { - string tmp = (const char *) prop; - setListMenuBoth(strlwr(tmp)); + setListMenuBoth(NLMISC::toLower(std::string((const char *) prop))); } prop= (char*) xmlGetProp (cur, (xmlChar*)"frozen"); diff --git a/code/ryzom/client/src/interface_v3/interface_options.cpp b/code/ryzom/client/src/interface_v3/interface_options.cpp index ae70f1460..0b3fc6f94 100644 --- a/code/ryzom/client/src/interface_v3/interface_options.cpp +++ b/code/ryzom/client/src/interface_v3/interface_options.cpp @@ -85,7 +85,7 @@ bool CInterfaceOptions::parse (xmlNodePtr cur) } else { - string name = strlwr (string((const char*)ptr)); + string name = NLMISC::toLower(string((const char*)ptr)); string value = (string((const char*)val)); _ParamValue[name].init(value); } diff --git a/code/ryzom/client/src/string_manager_client.cpp b/code/ryzom/client/src/string_manager_client.cpp index 1e7fd23be..ac016b299 100644 --- a/code/ryzom/client/src/string_manager_client.cpp +++ b/code/ryzom/client/src/string_manager_client.cpp @@ -1225,9 +1225,8 @@ void CStringManagerClient::initI18NSpecialWords(const std::string &languageCode) const ucstring &key= ws.getData(j, keyColIndex); const ucstring &name= ws.getData(j, nameColIndex); // Append to the I18N. - string keyStr= key.toString(); // avoid case problems - strlwr(keyStr); + string keyStr= NLMISC::toLower(key.toString()); // append the special key extension. keyStr+= keyExtenstion; diff --git a/code/ryzom/server/src/ai_service/ai_grp_npc.cpp b/code/ryzom/server/src/ai_service/ai_grp_npc.cpp index 8dad00290..482031d18 100644 --- a/code/ryzom/server/src/ai_service/ai_grp_npc.cpp +++ b/code/ryzom/server/src/ai_service/ai_grp_npc.cpp @@ -586,7 +586,7 @@ void CGroupNpc::addParameter(std::string const& parameter) std::string key, tail; // force lowercase - std::string p = NLMISC::strlwr(parameter); + std::string p = NLMISC::toLower(parameter); AI_SHARE::stringToKeywordAndTail(p, key, tail); breakable diff --git a/code/ryzom/server/src/ai_service/ai_outpost_actions.cpp b/code/ryzom/server/src/ai_service/ai_outpost_actions.cpp index 3a256a582..65063892c 100644 --- a/code/ryzom/server/src/ai_service/ai_outpost_actions.cpp +++ b/code/ryzom/server/src/ai_service/ai_outpost_actions.cpp @@ -648,7 +648,7 @@ DEFINE_ACTION_TEMPLATE1(ContextOutpostGroupDesc,GT_GPRM,FamilyT) string param; args[i].get(param); - param = strlwr(param); + param = NLMISC::toLower(param); if ( param == "contact camp" || param == "contact outpost" diff --git a/code/ryzom/server/src/ai_service/continent_inline.h b/code/ryzom/server/src/ai_service/continent_inline.h index 0dd3ca8f2..1da81adea 100644 --- a/code/ryzom/server/src/ai_service/continent_inline.h +++ b/code/ryzom/server/src/ai_service/continent_inline.h @@ -1053,7 +1053,7 @@ DEFINE_ACTION_TEMPLATE1(ContextGroupDesc,GT_GPRM,FamilyT) std::string param; args[i].get(param); - param = NLMISC::strlwr(param); + param = NLMISC::toLower(param); if ( param == "contact camp" || param == "contact outpost" diff --git a/code/ryzom/server/src/server_share/continent_container.cpp b/code/ryzom/server/src/server_share/continent_container.cpp index a6986574d..99df7c879 100644 --- a/code/ryzom/server/src/server_share/continent_container.cpp +++ b/code/ryzom/server/src/server_share/continent_container.cpp @@ -85,8 +85,8 @@ void CContinentContainer::loadContinent(string name, string file, sint index, bo for (its=_SheetMap.begin(); its!=_SheetMap.end(); ++its) { - if (strlwr((*its).second.Name) == strlwr(name+".continent") || - strlwr((*its).second.PacsRBank) == strlwr(name+".rbank")) + if (NLMISC::toLower((*its).second.Name) == NLMISC::toLower(name+".continent") || + NLMISC::toLower((*its).second.PacsRBank) == NLMISC::toLower(name+".rbank")) { if (found == _SheetMap.end()) { @@ -264,14 +264,14 @@ void CContinentContainer::initPacsPrim(const string &path) for(k=0; kgetPropertyByName("once", s); - _Once = (strlwr(s) == "true"); + _Once = (NLMISC::toLower(s) == "true"); } string genCode(CMissionData &md) @@ -2863,7 +2863,7 @@ public: { _GroupName = md.getProperty(prim, "group_to_escort", true, false); string s = md.getProperty(prim, "save_all", true, false); - _SaveAll = (strlwr(s) == "true"); + _SaveAll = (NLMISC::toLower(s) == "true"); CContentObjective::init(md, prim); } diff --git a/code/ryzom/tools/leveldesign/prim_export/main.cpp b/code/ryzom/tools/leveldesign/prim_export/main.cpp index 2a1a4c600..51c12f0e3 100644 --- a/code/ryzom/tools/leveldesign/prim_export/main.cpp +++ b/code/ryzom/tools/leveldesign/prim_export/main.cpp @@ -519,7 +519,7 @@ public: formDate = 0; // In the map ? - string formShortName = strlwr (CFile::getFilename (formName)); + string formShortName = NLMISC::toLower(CFile::getFilename (formName)); map::iterator ite = _FormMap.find (formShortName); if (ite == _FormMap.end ()) { @@ -606,7 +606,7 @@ void addPointPrimitive (CLandscape &landscape, const char *primFilename, uint32 if (point->getPropertyByName ("form", plantFilename)) { // Add an extension - if (strlwr (CFile::getExtension (plantFilename)) != "plant") + if (NLMISC::toLower(CFile::getExtension (plantFilename)) != "plant") plantFilename += ".plant"; // Load this form @@ -661,7 +661,7 @@ void addPointPrimitive (CLandscape &landscape, const char *primFilename, uint32 instance.Scale = CVector (scale, scale, scale); instance.nParent = -1; instance.Name = shape; - instance.InstanceName = strlwr (CFile::getFilename (plantFilename)); + instance.InstanceName = NLMISC::toLower(CFile::getFilename (plantFilename)); // Get the instance group ref CIgContainer::CIG &instances = igs.get (x, y); @@ -817,7 +817,7 @@ int main (int argc, char**argv) callback.progress ((float)i/(float)files.size ()); // Zonew ? - if (strlwr (CFile::getExtension (files[i])) == "zonew") + if (NLMISC::toLower(CFile::getExtension (files[i])) == "zonew") { // Load it try @@ -881,7 +881,7 @@ int main (int argc, char**argv) for (i=0; i &combatAnimSets) { // look if this animSetFile is in the combat list to patch - string shortName= CFile::getFilenameWithoutExtension(animSetFile); - strlwr(shortName); + string shortName= NLMISC::toLower(CFile::getFilenameWithoutExtension(animSetFile)); CAnimCombatSet key; key.Name= shortName; set::const_iterator it= combatAnimSets.find(key); @@ -406,8 +405,7 @@ To generate the anim.txt file, this code has to be inserted in the client, in if(anim && anim3d) { // name - string name= _AnimationSet->getAnimationName(anim->id()); - strlwr(name); + string name= NLMISC::toLower(_AnimationSet->getAnimationName(anim->id())); if(animName.empty()) animName= name; else if(!extended) diff --git a/code/ryzom/tools/patch_gen/patch_gen_common.cpp b/code/ryzom/tools/patch_gen/patch_gen_common.cpp index a446c9d7f..be58a37f9 100644 --- a/code/ryzom/tools/patch_gen/patch_gen_common.cpp +++ b/code/ryzom/tools/patch_gen/patch_gen_common.cpp @@ -429,8 +429,8 @@ void CPackageDescription::buildDefaultFileList() std::vector fileList; NLMISC::CPath::getPathContent(_BnpDirectory,false,false,true,fileList); for (uint32 i=0;iDescription.empty()) Hpp << db->Description << "\n"; - string filename = strlwr(CFile::getFilenameWithoutExtension(Name)); + string filename = NLMISC::toLower(CFile::getFilenameWithoutExtension(Name)); setEnv("fullfilename", getFullStdPathNoExt(Name)); setEnv("filename", filename); @@ -867,7 +867,7 @@ bool CFileNode::generateProlog() if (SeparatedFlag) { string fullfile = getFullStdPathNoExt(db->MainFile.empty() ? db->Name : db->MainFile); - string filename = NLMISC::strlwr(NLMISC::CFile::getFilenameWithoutExtension(fullfile)); + string filename = NLMISC::toLower(NLMISC::CFile::getFilenameWithoutExtension(fullfile)); Hpp << "#include \"" << filename << ".h\"\n"; Hpp << "\n"; } @@ -917,7 +917,7 @@ bool CFileNode::generateEpilog() CDbNode* db = getDbNode(); string fullfile = getFullStdPathNoExt(Name); - string filename = strlwr(CFile::getFilenameWithoutExtension(Name)); + string filename = NLMISC::toLower(CFile::getFilenameWithoutExtension(Name)); Hpp.indent(); Hpp << "\n} // End of " << db->Name <<"\n"; @@ -945,14 +945,14 @@ bool CFileNode::generateEpilog() string CFileNode::getFileNoExtPath(const string& file) { - string thisPath = NLMISC::CFile::getPath(strlwr(Name)); - string filePath = NLMISC::CFile::getPath(strlwr(file)); - string fileName = NLMISC::CFile::getFilename(strlwr(file)); + string thisPath = NLMISC::CFile::getPath(NLMISC::toLower(Name)); + string filePath = NLMISC::CFile::getPath(NLMISC::toLower(file)); + string fileName = NLMISC::CFile::getFilename(NLMISC::toLower(file)); if (thisPath == filePath) return CFile::getFilenameWithoutExtension(fileName); else - return CFile::getFilenameWithoutExtension(strlwr(file)); + return CFile::getFilenameWithoutExtension(NLMISC::toLower(file)); } void CFileNode::writeFile() diff --git a/code/ryzom/tools/server/build_world_packed_col/village.cpp b/code/ryzom/tools/server/build_world_packed_col/village.cpp index f2338d4ec..8d3681878 100644 --- a/code/ryzom/tools/server/build_world_packed_col/village.cpp +++ b/code/ryzom/tools/server/build_world_packed_col/village.cpp @@ -266,7 +266,7 @@ void CIGInfo::load(TShapeCache &shapeCache) for(uint k = 0; k < IG->getNumInstance(); ++k) { std::string shapeName = standardizeShapeName(IG->getShapeName(k)); - if (NLMISC::strlwr(CFile::getExtension(shapeName)) == "pacs_prim") + if (NLMISC::toLower(CFile::getExtension(shapeName)) == "pacs_prim") { continue; }