Changed: Replaced some NLMISC::strlwr by NLMISC::toLower

This commit is contained in:
kervala 2015-11-13 16:22:49 +01:00
parent 7f7e4bcfb4
commit 3a261957f2
42 changed files with 129 additions and 180 deletions

View file

@ -519,17 +519,17 @@ namespace NLGUI
// Read Action handlers
prop = (char*) xmlGetProp( node, (xmlChar*)"onscroll" );
if (prop) _AHOnScroll = NLMISC::strlwr(prop.str());
if (prop) _AHOnScroll = NLMISC::toLower(prop.str());
prop = (char*) xmlGetProp( node, (xmlChar*)"params" );
if (prop) _AHOnScrollParams = string((const char*)prop);
//
prop = (char*) xmlGetProp( node, (xmlChar*)"onscrollend" );
if (prop) _AHOnScrollEnd = NLMISC::strlwr(prop.str());
if (prop) _AHOnScrollEnd = NLMISC::toLower(prop.str());
prop = (char*) xmlGetProp( node, (xmlChar*)"end_params" );
if (prop) _AHOnScrollEndParams = string((const char*)prop);
//
prop = (char*) xmlGetProp( node, (xmlChar*)"onscrollcancel" );
if (prop) _AHOnScrollCancel = NLMISC::strlwr(prop.str());
if (prop) _AHOnScrollCancel = NLMISC::toLower(prop.str());
prop = (char*) xmlGetProp( node, (xmlChar*)"cancel_params" );
if (prop) _AHOnScrollCancelParams = string((const char*)prop);

View file

@ -606,11 +606,7 @@ namespace NLGUI
}
prop = (char*) xmlGetProp( cur, (xmlChar*)"menu_r" );
if (prop)
{
string tmp = (const char *) prop;
_ListMenuRight = strlwr(tmp);
}
if (prop) _ListMenuRight = toLower((const char *) prop);
prop = (char*) xmlGetProp( cur, (xmlChar*)"max_historic" );
if (prop) fromString((const char*)prop, _MaxHistoric);

View file

@ -772,8 +772,7 @@ namespace NLGUI
cellParams.NoWrap = true; \
if (present[prefix##_ALIGN] && value[prefix##_ALIGN]) \
{ \
string align = value[prefix##_ALIGN]; \
align = strlwr(align); \
string align = toLower(value[prefix##_ALIGN]); \
if (align == "left") \
cellParams.Align = CGroupCell::Left; \
if (align == "center") \
@ -783,8 +782,7 @@ namespace NLGUI
} \
if (present[prefix##_VALIGN] && value[prefix##_VALIGN]) \
{ \
string align = value[prefix##_VALIGN]; \
align = strlwr(align); \
string align = toLower(value[prefix##_VALIGN]); \
if (align == "top") \
cellParams.VAlign = CGroupCell::Top; \
if (align == "middle") \
@ -1182,7 +1180,7 @@ namespace NLGUI
if (it != styles.end())
{
string image = it->second;
string::size_type texExt = strlwr(image).find("url(");
string::size_type texExt = toLower(image).find("url(");
// Url image
if (texExt != string::npos)
// Remove url()
@ -1321,8 +1319,7 @@ namespace NLGUI
if (present[MY_HTML_INPUT_ALT] && value[MY_HTML_INPUT_ALT])
tooltip = value[MY_HTML_INPUT_ALT];
string type = value[MY_HTML_INPUT_TYPE];
type = strlwr (type);
string type = toLower(value[MY_HTML_INPUT_TYPE]);
if (type == "image")
{
// The submit button
@ -1668,7 +1665,7 @@ namespace NLGUI
{
nlinfo("found background-image %s", it->second.c_str());
string image = (*it).second;
string::size_type texExt = strlwr(image).find("url(");
string::size_type texExt = toLower(image).find("url(");
// Url image
if (texExt != string::npos)
{
@ -3826,7 +3823,7 @@ namespace NLGUI
// folder used for images cache
static const string cacheDir = "cache";
string::size_type protocolPos = strlwr(result).find("://");
string::size_type protocolPos = toLower(result).find("://");
if (protocolPos != string::npos)
{
@ -3840,7 +3837,7 @@ namespace NLGUI
else
{
// Url is a file ?
if (strlwr(result).find("file:") == 0)
if (toLower(result).find("file:") == 0)
{
result = result.substr(5, result.size()-5);
}
@ -3857,7 +3854,7 @@ namespace NLGUI
{
// Normalize the path
if (isUrl)
//result = "file:"+strlwr(CPath::standardizePath (CPath::getFullPath (CFile::getPath(result)))+CFile::getFilename(result));*/
//result = "file:"+toLower(CPath::standardizePath (CPath::getFullPath (CFile::getPath(result)))+CFile::getFilename(result));*/
result = "file:/"+tmp;
else
result = tmp;
@ -4114,7 +4111,7 @@ namespace NLGUI
void CGroupHTML::doBrowseLocalFile(const std::string &uri)
{
std::string filename;
if (strlwr(uri).find("file:/") == 0)
if (toLower(uri).find("file:/") == 0)
{
filename = uri.substr(6, uri.size() - 6);
}
@ -4978,7 +4975,7 @@ namespace NLGUI
else
if (it->first == "text-decoration" || it->first == "text-decoration-line")
{
std::string prop(strlwr(it->second));
std::string prop(toLower(it->second));
style.Underlined = (prop.find("underline") != std::string::npos);
style.StrikeThrough = (prop.find("line-through") != std::string::npos);
}

View file

@ -55,8 +55,7 @@ namespace NLGUI
if (ptr) _Dynamic = CInterfaceElement::convertBool (ptr);
ptr = xmlGetProp (cur, (xmlChar*)"type");
string sTmp = ptr.str();
sTmp = strlwr(sTmp);
string sTmp = toLower(ptr.str());
if (sTmp == "linear")
_Type = Track_Linear;
else if (sTmp == "bezier")

View file

@ -312,8 +312,7 @@ namespace NLGUI
ptr = (char*) xmlGetProp( cur, (xmlChar*)"max_sizeparent" );
if (ptr)
{
string idparent = ptr.str();
idparent = NLMISC::strlwr(idparent);
string idparent = NLMISC::toLower(ptr.str());
if (idparent != "parent")
{
if (parentGroup)

View file

@ -127,8 +127,7 @@ namespace NLGUI
// ***************************************************************************
const CInterfaceOptionValue &CInterfaceOptions::getValue(const string &sParamName) const
{
string sLwrParamName = strlwr (sParamName);
std::map<std::string, CInterfaceOptionValue>::const_iterator it = _ParamValue.find (sLwrParamName);
std::map<std::string, CInterfaceOptionValue>::const_iterator it = _ParamValue.find (toLower(sParamName));
if (it != _ParamValue.end())
return it->second;
else

View file

@ -1359,6 +1359,9 @@ namespace NLGUI
{
CXMLAutoPtr ptr((const char*) xmlGetProp( cur, (xmlChar*)"node" ));
if (!ptr) return false;
string stmp2 = toLower(string((const char*)ptr));
CInterfaceElement *pEltFound = NULL;
std::vector< CWidgetManager::SMasterGroup > &_MasterGroups = CWidgetManager::getInstance()->getAllMasterGroup();
for (uint32 i = 0; i < _MasterGroups.size(); ++i)
@ -1367,8 +1370,8 @@ namespace NLGUI
for (uint32 j = 0; j < rMG.Group->getGroups().size(); ++j)
{
CInterfaceGroup *pIG = rMG.Group->getGroups()[j];
string stmp = strlwr(pIG->getId().substr(pIG->getId().rfind(':')+1,pIG->getId().size()));
string stmp2 = strlwr(string((const char*)ptr));
string stmp = toLower(pIG->getId().substr(pIG->getId().rfind(':')+1,pIG->getId().size()));
if (stmp == stmp2)
{
pEltFound = pIG;
@ -1408,6 +1411,9 @@ namespace NLGUI
{
CXMLAutoPtr ptr((const char*) xmlGetProp( cur, (xmlChar*)"node" ));
if (!ptr) return false;
string stmp2 = toLower(string((const char*)ptr));
std::vector< CWidgetManager::SMasterGroup > &_MasterGroups = CWidgetManager::getInstance()->getAllMasterGroup();
CInterfaceElement *pEltFound = NULL;
for (uint32 i = 0; i < _MasterGroups.size(); ++i)
@ -1416,8 +1422,7 @@ namespace NLGUI
for (uint32 j = 0; j < rMG.Group->getGroups().size(); ++j)
{
CInterfaceGroup *pIG = rMG.Group->getGroups()[j];
string stmp = strlwr(pIG->getId().substr(pIG->getId().rfind(':')+1,pIG->getId().size()));
string stmp2 = strlwr(string((const char*)ptr));
string stmp = toLower(pIG->getId().substr(pIG->getId().rfind(':')+1,pIG->getId().size()));
if (stmp == stmp2)
{
pEltFound = pIG;
@ -1600,6 +1605,9 @@ namespace NLGUI
{
CXMLAutoPtr ptr((const char*) xmlGetProp( cur, (xmlChar*)"node" ));
if (!ptr) return false;
string stmp2 = toLower(string((const char*)ptr));
std::vector< CWidgetManager::SMasterGroup > &_MasterGroups = CWidgetManager::getInstance()->getAllMasterGroup();
CInterfaceElement *pEltFound = NULL;
for (uint32 i = 0; i < _MasterGroups.size(); ++i)
@ -1608,8 +1616,8 @@ namespace NLGUI
for (uint32 j = 0; j < rMG.Group->getGroups().size(); ++j)
{
CInterfaceGroup *pIG = rMG.Group->getGroups()[j];
string stmp = strlwr(pIG->getId().substr(pIG->getId().rfind(':')+1,pIG->getId().size()));
string stmp2 = strlwr(string((const char*)ptr));
string stmp = toLower(pIG->getId().substr(pIG->getId().rfind(':')+1,pIG->getId().size()));
if (stmp == stmp2)
{
pEltFound = pIG;

View file

@ -84,56 +84,43 @@ namespace NLGUI
_OffsetY = getY();
prop = (char*) xmlGetProp (cur, (xmlChar*)"tx_default");
if (prop) _TxDefault = (const char *) prop;
_TxDefault = NLMISC::strlwr (_TxDefault);
if (prop) _TxDefault = NLMISC::toLower ((const char *) prop);
prop = (char*) xmlGetProp (cur, (xmlChar*)"tx_move_window");
if (prop) _TxMoveWindow = (const char *) prop;
_TxMoveWindow = NLMISC::strlwr (_TxMoveWindow);
if (prop) _TxMoveWindow = NLMISC::toLower ((const char *) prop);
prop = (char*) xmlGetProp (cur, (xmlChar*)"tx_resize_BR_TL");
if (prop) _TxResizeBRTL = (const char *) prop;
_TxResizeBRTL = NLMISC::strlwr (_TxResizeBRTL);
if (prop) _TxResizeBRTL = NLMISC::toLower ((const char *) prop);
prop = (char*) xmlGetProp (cur, (xmlChar*)"tx_resize_BL_TR");
if (prop) _TxResizeBLTR = (const char *) prop;
_TxResizeBLTR = NLMISC::strlwr (_TxResizeBLTR);
if (prop) _TxResizeBLTR = NLMISC::toLower ((const char *) prop);
prop = (char*) xmlGetProp (cur, (xmlChar*)"tx_resize_TB");
if (prop) _TxResizeTB = (const char *) prop;
_TxResizeTB = NLMISC::strlwr (_TxResizeTB);
if (prop) _TxResizeTB = NLMISC::toLower ((const char *) prop);
prop = (char*) xmlGetProp (cur, (xmlChar*)"tx_resize_LR");
if (prop) _TxResizeLR = (const char *) prop;
_TxResizeLR = NLMISC::strlwr (_TxResizeLR);
if (prop) _TxResizeLR = NLMISC::toLower ((const char *) prop);
prop = (char*) xmlGetProp (cur, (xmlChar*)"tx_rotate");
if (prop) _TxRotate = (const char *) prop;
_TxRotate = NLMISC::strlwr (_TxRotate);
if (prop) _TxRotate = NLMISC::toLower ((const char *) prop);
prop = (char*) xmlGetProp (cur, (xmlChar*)"tx_scale");
if (prop) _TxScale = (const char *) prop;
_TxScale = NLMISC::strlwr (_TxScale);
if (prop) _TxScale = NLMISC::toLower ((const char *) prop);
prop = (char*) xmlGetProp (cur, (xmlChar*)"tx_colpick");
if (prop) _TxColPick = (const char *) prop;
_TxColPick = NLMISC::strlwr (_TxColPick);
if (prop) _TxColPick = NLMISC::toLower ((const char *) prop);
prop = (char*) xmlGetProp (cur, (xmlChar*)"tx_pan");
if (prop) _TxPan = (const char *) prop;
_TxPan = NLMISC::strlwr (_TxPan);
if (prop) _TxPan = NLMISC::toLower ((const char *) prop);
prop = (char*) xmlGetProp (cur, (xmlChar*)"tx_can_pan");
if (prop) _TxCanPan = (const char *) prop;
_TxCanPan = NLMISC::strlwr (_TxCanPan);
if (prop) _TxCanPan = NLMISC::toLower ((const char *) prop);
prop = (char*) xmlGetProp (cur, (xmlChar*)"tx_pan_r2");
if (prop) _TxPanR2 = (const char *) prop;
_TxPanR2 = NLMISC::strlwr (_TxPanR2);
if (prop) _TxPanR2 = NLMISC::toLower ((const char *) prop);
prop = (char*) xmlGetProp (cur, (xmlChar*)"tx_can_pan_r2");
if (prop) _TxCanPanR2 = (const char *) prop;
_TxCanPanR2 = NLMISC::strlwr (_TxCanPanR2);
if (prop) _TxCanPanR2 = NLMISC::toLower ((const char *) prop);
prop = (char*) xmlGetProp (cur, (xmlChar*)"color");
if (prop) _Color = convertColor(prop);

View file

@ -854,12 +854,11 @@ namespace NLGUI
return;
}
// Look if already existing
string sLwrGTName = strlwr(sGlobalTextureName);
string sLwrGTName = toLower(sGlobalTextureName);
TGlobalTextureList::iterator ite = _GlobalTextures.begin();
while (ite != _GlobalTextures.end())
{
std::string sText = strlwr(ite->Name);
if (sText == sLwrGTName)
if (toLower(ite->Name) == sLwrGTName)
break;
ite++;
}
@ -984,11 +983,11 @@ namespace NLGUI
*/
NL3D::UTexture *CViewRenderer::getGlobalTexture(const std::string &name)
{
string sLwrGTName = strlwr(name);
string sLwrGTName = NLMISC::toLower(name);
TGlobalTextureList::iterator ite = _GlobalTextures.begin();
while (ite != _GlobalTextures.end())
{
std::string sText = strlwr(ite->Name);
std::string sText = NLMISC::toLower(ite->Name);
if (sText == sLwrGTName)
break;
ite++;

View file

@ -61,8 +61,7 @@ void CAnimationFX::buildTrack(NL3D::UAnimationSet *as)
nlassert(Sheet != NULL);
if (!as) return;
if (Sheet->TrajectoryAnim.empty()) return;
std::string animName = Sheet->TrajectoryAnim;
NLMISC::strlwr(animName);
std::string animName = NLMISC::toLower(Sheet->TrajectoryAnim);
uint id = as->getAnimationIdByName(animName);
NL3D::UAnimation *anim = NULL;
if (id != NL3D::UAnimationSet::NotFound)

View file

@ -81,7 +81,7 @@ void initAutoAnimation()
file.getline(line, 512);
// Read the animation file
string animName = strlwr (CFile::getFilenameWithoutExtension(line));
string animName = toLower(CFile::getFilenameWithoutExtension(line));
uint id = AutoAnimSet->addAnimation (line, animName.c_str ());
if (id == UAnimationSet::NotFound)
{

View file

@ -610,7 +610,7 @@ uint32 CCharacterCL::buildEquipment(const CCharacterSheet::CEquipment &slot, SLO
{
// IS the item a valid one ?
CSheetId itemId;
if(itemId.buildSheetId(NLMISC::strlwr(slot.getItem())))
if(itemId.buildSheetId(NLMISC::toLower(slot.getItem())))
{
// Is it stored in the database ?
CEntitySheet *entitySheet = SheetMngr.get(itemId);
@ -1098,7 +1098,7 @@ string CCharacterCL::automatonType() const // virtual
//-----------------------------------------------
void CCharacterCL::computeAutomaton()
{
_CurrentAutomaton = automatonType() + "_" + NLMISC::strlwr(MBEHAV::modeToString(_Mode)) + ".automaton";
_CurrentAutomaton = automatonType() + "_" + NLMISC::toLower(MBEHAV::modeToString(_Mode)) + ".automaton";
}// computeAutomaton //

View file

@ -520,7 +520,7 @@ int main(int argc, char **argv)
uint i;
for (i=0; i<files.size(); i++)
{
if (strlwr (CFile::getExtension (files[i])) == "ttf")
if (toLower(CFile::getExtension (files[i])) == "ttf")
CFile::deleteFile (files[i]);
}
}

View file

@ -929,7 +929,7 @@ NLMISC_COMMAND(verbose, "Enable/Disable some Debug Information", "none or magic"
}
else
{
std::string type = NLMISC::strlwr(args[0]);
std::string type = NLMISC::toLower(args[0]);
if (type == "none")
Verbose = VerboseNone;
else if(type == "magic")

View file

@ -522,7 +522,7 @@ void CContinent::select(const CVectorD &pos, NLMISC::IProgressCallback &progress
// Associate IGs with the ZC number or -1 if there is no ZC.
for(uint i = 0; i<igsWithNames.size(); ++i)
{
string igZone = strlwr(CFile::getFilenameWithoutExtension(igsWithNames[i].second));
string igZone = toLower(CFile::getFilenameWithoutExtension(igsWithNames[i].second));
// Search for the IG name in the ZC list to associate.
for(uint j = 0; j<ZCList.size(); ++j)
@ -532,7 +532,7 @@ void CContinent::select(const CVectorD &pos, NLMISC::IProgressCallback &progress
if (outpost)
{
// If name matching -> this zone should be a ZC.
string outpostZone = strlwr(CFile::getFilenameWithoutExtension(ZCList[j].Name));
string outpostZone = toLower(CFile::getFilenameWithoutExtension(ZCList[j].Name));
if(igZone == outpostZone)
{
nlctassert(RZ_MAX_BUILDING_PER_OUTPOST==4);
@ -788,7 +788,7 @@ void CContinent::reloadFogMap()
const R2::CScenarioEntryPoints::CCompleteIsland *completeIsland = R2::CScenarioEntryPoints::getInstance().getCompleteIslandFromCoords(CVector2f((float) UserEntity->pos().x, (float) UserEntity->pos().y));
if (completeIsland)
{
std::string islandName = strlwr(completeIsland->Island);
std::string islandName = toLower(completeIsland->Island);
std::string::size_type lastPos = islandName.find_last_of("_");
if (lastPos != std::string::npos)
{

View file

@ -183,7 +183,7 @@ void CContinentManager::preloadSheets()
for (i = 0; i < ws->ContLocs.size(); ++i)
{
const SContLoc &clTmp = ws->ContLocs[i];
std::string continentSheetName = NLMISC::strlwr(clTmp.ContinentName);
std::string continentSheetName = NLMISC::toLower(clTmp.ContinentName);
if (continentSheetName.find(".continent") == std::string::npos)
{
continentSheetName += ".continent";

View file

@ -248,8 +248,7 @@ void CDoorManager::SDoor::checkToClose()
std::string CDoorManager::transformName (uint /* index */, const std::string &/* instanceName */, const std::string &shapeName)
{
if (shapeName.rfind('.') == string::npos) return shapeName;
string sExt = shapeName.substr(shapeName.rfind('.')+1,shapeName.size());
sExt = strlwr(sExt);
string sExt = toLower(shapeName.substr(shapeName.rfind('.')+1,shapeName.size()));
if (sExt != "pacs_prim") return shapeName;
return ""; // Do not load a pacs prim as a mesh...
}
@ -266,8 +265,7 @@ void CDoorManager::loadedCallback (NL3D::UInstanceGroup *ig)
string sShapeName = ig->getShapeName(k);
if (sShapeName.rfind('.') == string::npos) continue;
string sExt = sShapeName.substr(sShapeName.rfind('.')+1,sShapeName.size());
sExt = strlwr(sExt);
string sExt = toLower(sShapeName.substr(sShapeName.rfind('.')+1,sShapeName.size()));
if (sExt != "pacs_prim") continue;
// Check if the pacs_prim is a door detection
@ -349,7 +347,7 @@ void CDoorManager::loadedCallback (NL3D::UInstanceGroup *ig)
case SDoor::Matis3PartBourgeon:
{
string sDebug = ig->getShapeName(i);
sDebug = strlwr(sDebug.substr(sDebug.rfind('_')+1,sDebug.size()));
sDebug = toLower(sDebug.substr(sDebug.rfind('_')+1,sDebug.size()));
if (sDebug == "gauche")
pDoor->Instances[0] = i;
else if (sDebug == "droite")
@ -362,7 +360,7 @@ void CDoorManager::loadedCallback (NL3D::UInstanceGroup *ig)
case SDoor::Zorai2Part:
{
string sDebug = ig->getShapeName(i);
sDebug = strlwr(sDebug.substr(sDebug.rfind('_')+1,sDebug.size()));
sDebug = toLower(sDebug.substr(sDebug.rfind('_')+1,sDebug.size()));
if (sDebug == "gauche")
pDoor->Instances[0] = i;
else if (sDebug == "droite")

View file

@ -205,7 +205,7 @@ void CEntityAnimationManager::load(NLMISC::IProgressCallback &/* progress */, bo
for (uint32 i = 0; i < pASLS->AnimSetList.size(); ++i)
{
CAnimationSet as;
string sTmp = strlwr(pASLS->AnimSetList[i].Name);
string sTmp = toLower(pASLS->AnimSetList[i].Name);
sTmp = sTmp.substr(0,sTmp.rfind('.'));
pair<map<string,CAnimationSet>::iterator, bool> it;
it = _AnimSet.insert(pair<string,CAnimationSet>(sTmp,as));

View file

@ -520,7 +520,7 @@ void CGroundFXManager::update(const NLMISC::CVectorD &camPos)
}
if (!fxName.empty())
{
stdFXName = NLMISC::strlwr(NLMISC::CFile::getFilenameWithoutExtension(fxName));
stdFXName = NLMISC::toLower(NLMISC::CFile::getFilenameWithoutExtension(fxName));
}
// is an fx already attached to the entity ?
if (_SortedInstances[k]->HasFX)

View file

@ -197,7 +197,7 @@ void CIGCallback::CIGInstance::instanceGroupAdded()
uint numInstances = _IG->getNumInstance();
for(uint k = 0; k < numInstances; ++k)
{
TPacsPrimMap::iterator pbIt = PacsPrims.find(NLMISC::strlwr(NLMISC::CFile::getFilenameWithoutExtension(_IG->getShapeName(k))));
TPacsPrimMap::iterator pbIt = PacsPrims.find(NLMISC::toLower(NLMISC::CFile::getFilenameWithoutExtension(_IG->getShapeName(k))));
if (pbIt != PacsPrims.end())
{
// compute orientation and position

View file

@ -505,8 +505,7 @@ void checkDriverVersion()
uint i;
for (i=0; i< sizeofarray(driversVersion); i++)
{
string lwr = deviceName;
strlwr(lwr);
string lwr = toLower(deviceName);
if ((lwr.find (driversTest[i])!=string::npos) && (driversNTest[i]==NULL || lwr.find (driversNTest[i])==string::npos))
{
if (driverVersion < driversVersion[i])
@ -1290,7 +1289,7 @@ void initBotObjectSelection()
{
// IS the item a valid one ?
CSheetId itemId;
if(itemId.buildSheetId(NLMISC::strlwr(strShape)))
if(itemId.buildSheetId(NLMISC::toLower(strShape)))
{
// Get this item sheet ?
CItemSheet *itemSheet= dynamic_cast<CItemSheet *>(SheetMngr.get(itemId));

View file

@ -333,29 +333,29 @@ bool CCtrlSheetInfo::parseCtrlInfo(xmlNodePtr cur, CInterfaceGroup * /* parentGr
prop = (char*) xmlGetProp( cur, (xmlChar*)"nature" );
if (prop)
{
if (NLMISC::strlwr(prop.str()) == "item")
if (NLMISC::toLower(prop.str()) == "item")
_Type = CCtrlSheetInfo::SheetType_Item;
else if (NLMISC::strlwr(prop.str()) == "pact")
else if (NLMISC::toLower(prop.str()) == "pact")
_Type = CCtrlSheetInfo::SheetType_Pact;
else if (NLMISC::strlwr(prop.str()) == "skill")
else if (NLMISC::toLower(prop.str()) == "skill")
_Type = CCtrlSheetInfo::SheetType_Skill;
else if (NLMISC::strlwr(prop.str()) == "auto")
else if (NLMISC::toLower(prop.str()) == "auto")
_Type = CCtrlSheetInfo::SheetType_Auto;
else if (NLMISC::strlwr(prop.str()) == "macro")
else if (NLMISC::toLower(prop.str()) == "macro")
_Type = CCtrlSheetInfo::SheetType_Macro;
else if (NLMISC::strlwr(prop.str()) == "guild_flag")
else if (NLMISC::toLower(prop.str()) == "guild_flag")
_Type = CCtrlSheetInfo::SheetType_GuildFlag;
else if (NLMISC::strlwr(prop.str()) == "mission")
else if (NLMISC::toLower(prop.str()) == "mission")
_Type = CCtrlSheetInfo::SheetType_Mission;
else if (NLMISC::strlwr(prop.str()) == "sbrick")
else if (NLMISC::toLower(prop.str()) == "sbrick")
_Type = CCtrlSheetInfo::SheetType_SBrick;
else if (NLMISC::strlwr(prop.str()) == "sphraseid")
else if (NLMISC::toLower(prop.str()) == "sphraseid")
_Type = CCtrlSheetInfo::SheetType_SPhraseId;
else if (NLMISC::strlwr(prop.str()) == "sphrase")
else if (NLMISC::toLower(prop.str()) == "sphrase")
_Type = CCtrlSheetInfo::SheetType_SPhrase;
else if (NLMISC::strlwr(prop.str()) == "elevator_destination")
else if (NLMISC::toLower(prop.str()) == "elevator_destination")
_Type = CCtrlSheetInfo::SheetType_ElevatorDestination;
else if (NLMISC::strlwr(prop.str()) == "outpost_building")
else if (NLMISC::toLower(prop.str()) == "outpost_building")
_Type = CCtrlSheetInfo::SheetType_OutpostBuilding;
}
@ -363,8 +363,7 @@ bool CCtrlSheetInfo::parseCtrlInfo(xmlNodePtr cur, CInterfaceGroup * /* parentGr
prop = (char*) xmlGetProp( cur, (xmlChar*)"tx_noitem" );
if (prop)
{
string TxName = (const char *) prop;
TxName = strlwr (TxName);
string TxName = toLower((const char *) prop);
CViewRenderer &rVR = *CViewRenderer::getInstance();
_DispNoSheetBmpId = rVR.getTextureIdFromName (TxName);
}
@ -410,27 +409,23 @@ bool CCtrlSheetInfo::parseCtrlInfo(xmlNodePtr cur, CInterfaceGroup * /* parentGr
prop = (char*) xmlGetProp( cur, (xmlChar*)"menu_l" );
if (prop)
{
string tmp = (const char *) prop;
_ListMenuLeft = strlwr(tmp);
_ListMenuLeft = toLower((const char *) prop);
}
prop = (char*) xmlGetProp( cur, (xmlChar*)"menu_r" );
if (prop)
{
string tmp = (const char *) prop;
_ListMenuRight = strlwr(tmp);
_ListMenuRight = toLower((const char *) prop);
}
prop = (char*) xmlGetProp( cur, (xmlChar*)"menu_r_empty_slot" );
if (prop)
{
string tmp = (const char *) prop;
_ListMenuRightEmptySlot = strlwr(tmp);
_ListMenuRightEmptySlot = toLower((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(toLower((const char *) prop));
}
// _BrickTypeBitField
@ -1745,7 +1740,7 @@ void CDBCtrlSheet::resetCharBitmaps()
void CDBCtrlSheet::setupCharBitmaps(sint32 maxW, sint32 maxLine, sint32 maxWChar, bool topDown)
{
// Use the optString for the Macro name
_OptString = strlwr(_OptString);
_OptString = toLower(_OptString);
CInterfaceManager *pIM = CInterfaceManager::getInstance();
CViewRenderer &rVR = *CViewRenderer::getInstance();

View file

@ -74,7 +74,7 @@ void CCompassTarget::serial(NLMISC::IStream &f)
// for the name, try to save a string identifier if possible, because language may be changed between
// save & reload
f.serial(Name);
std::string language = strlwr(ClientCfg.LanguageCode);
std::string language = toLower(ClientCfg.LanguageCode);
f.serial(language);
f.serialEnum(_Type);
if (_Type == PosTracker)
@ -100,7 +100,7 @@ void CCompassTarget::serial(NLMISC::IStream &f)
// reset the compass to north to avoid incoherency
if (f.isReading())
{
if (strlwr(ClientCfg.LanguageCode) != language)
if (toLower(ClientCfg.LanguageCode) != language)
{
*this = CCompassTarget();
}

View file

@ -729,7 +729,7 @@ bool CDBGroupListAscensor::CSheetChildAscensor::isInvalidated(CDBGroupListSheetT
{
LIFT_ICONS::TLiftIcon li = (LIFT_ICONS::TLiftIcon)(icon & UINT64_CONSTANT(0x7FFFFFFFFFFFFFFF));
string str = strlwr(LIFT_ICONS::toString(li));
string str = toLower(LIFT_ICONS::toString(li));
Ctrl->setType(CCtrlSheetInfo::SheetType_Teleport_Location);
Ctrl->setSlot("asc_"+str+".tga");
}

View file

@ -294,7 +294,7 @@ bool CInterface3DScene::parse (xmlNodePtr cur, CInterfaceGroup *parentGroup)
CXMLAutoPtr ptr((const char*)xmlGetProp (cur, (xmlChar*)"name"));
string animName;
if (ptr)
animName = strlwr (CFile::getFilenameWithoutExtension(ptr.str()));
animName = toLower(CFile::getFilenameWithoutExtension(ptr.str()));
if (!animName.empty())
{
@ -1084,11 +1084,9 @@ bool CInterface3DIG::parse (xmlNodePtr cur, CInterface3DScene *parentGroup)
ptr = xmlGetProp (cur, (xmlChar*)"rot");
if (ptr) _Rot = convertVector(ptr);
string name;
ptr = xmlGetProp (cur, (xmlChar*)"name");
if (ptr) name = (const char*)ptr;
if (ptr) _Name = toLower((const char*)ptr);
_Name = strlwr(name);
_IG = UInstanceGroup::createInstanceGroup(_Name);
if (_IG == NULL)
return true; // Create anyway
@ -1202,7 +1200,7 @@ std::string CInterface3DIG::getName() const
// ----------------------------------------------------------------------------
void CInterface3DIG::setName (const std::string &ht)
{
string lwrname = strlwr(ht);
string lwrname = toLower(ht);
if (lwrname != _Name)
{
CInterface3DScene *pI3DS = dynamic_cast<CInterface3DScene*>(_Parent);
@ -1248,11 +1246,9 @@ bool CInterface3DShape::parse (xmlNodePtr cur, CInterface3DScene *parentGroup)
ptr = xmlGetProp (cur, (xmlChar*)"rot");
if (ptr) _Rot = convertVector(ptr);
string name;
ptr = xmlGetProp (cur, (xmlChar*)"name");
if (ptr) name = (const char*)ptr;
if (ptr) _Name = toLower((const char*)ptr);
_Name = strlwr(name);
_Instance = parentGroup->getScene()->createInstance(_Name);
if (_Instance.empty())
return false;
@ -1529,11 +1525,8 @@ bool CInterface3DFX::parse (xmlNodePtr cur, CInterface3DScene *parentGroup)
ptr = xmlGetProp (cur, (xmlChar*)"rot");
if (ptr) _Rot = convertVector(ptr);
string name;
ptr = xmlGetProp (cur, (xmlChar*)"name");
if (ptr) name = (const char*)ptr;
_Name = strlwr(name);
if (ptr) _Name = toLower((const char*)ptr);
return true;
}

View file

@ -2280,7 +2280,7 @@ void CInterfaceManager::displaySystemInfo(const ucstring &str, const string &cat
CRGBA color = CRGBA::White;
map<string, CClientConfig::SSysInfoParam>::const_iterator it = ClientCfg.SystemInfoParams.find(strlwr(cat));
map<string, CClientConfig::SSysInfoParam>::const_iterator it = ClientCfg.SystemInfoParams.find(toLower(cat));
if (it != ClientCfg.SystemInfoParams.end())
{
mode = it->second.Mode;
@ -2315,7 +2315,7 @@ void CInterfaceManager::displaySystemInfo(const ucstring &str, const string &cat
CRGBA CInterfaceManager::getSystemInfoColor(const std::string &cat)
{
CRGBA col = CRGBA::White;
map<string, CClientConfig::SSysInfoParam>::const_iterator it = ClientCfg.SystemInfoParams.find(strlwr(cat));
map<string, CClientConfig::SSysInfoParam>::const_iterator it = ClientCfg.SystemInfoParams.find(toLower(cat));
if (it != ClientCfg.SystemInfoParams.end())
col = it->second.Color;
return col;

View file

@ -3488,7 +3488,7 @@ CItemImage &CInventoryManager::getServerItem(uint inv, uint index)
// ***************************************************************************
CInventoryManager::TInvType CInventoryManager::invTypeFromString(const string &str)
{
string sTmp = strlwr(str);
string sTmp = toLower(str);
if (sTmp == "inv_bag") return InvBag;
if (sTmp == "inv_pa0") return InvPA0;
if (sTmp == "inv_pa1") return InvPA1;

View file

@ -243,7 +243,7 @@ public:
while (*bufferPtr)
{
// Concat the directory name with the filename
if (strlwr (CFile::getExtension(bufferPtr)) == "m3u")
if (toLower(CFile::getExtension(bufferPtr)) == "m3u")
playlists.push_back (path+bufferPtr);
else
filenames.push_back (path+bufferPtr);

View file

@ -155,10 +155,10 @@ bool CPeopleList::create(const CPeopleListDesc &desc, const CChatWindowDesc *cha
//==================================================================
sint CPeopleList::getIndexFromName(const ucstring &name) const
{
string sNameIn = strlwr(name.toString());
string sNameIn = toLower(name.toString());
for(uint k = 0; k < _Peoples.size(); ++k)
{
string sPeopleName = strlwr(_Peoples[k].getName().toString());
string sPeopleName = toLower(_Peoples[k].getName().toString());
if (sPeopleName == sNameIn) return k;
}
return -1;

View file

@ -404,8 +404,7 @@ void CSBrickManager::compileBrickProperties()
string::size_type pos = prop.Text.find(':');
if (pos != string::npos)
{
string key = prop.Text.substr(0, pos);
strlwr(key);
string key = toLower(prop.Text.substr(0, pos));
string value = prop.Text.substr(pos + 1);
// get key id.
if (_BrickPropIdMap.find(key) == _BrickPropIdMap.end())
@ -506,7 +505,7 @@ void CSBrickManager::compileBrickProperties()
// Parse all the brick properties if match the key
float value= 0.f;
// get the wanted prop id
strlwr(key);
key = toLower(key);
uint propId= getBrickPropId(key);
// if propid exist
if(propId)

View file

@ -59,8 +59,7 @@ bool CViewBitmapFaberMp::parse(xmlNodePtr cur, CInterfaceGroup * parentGroup)
prop = (char*) xmlGetProp( cur, (xmlChar*)"tx_noitem" );
if (prop)
{
_TextureNoItemName = (const char *) prop;
_TextureNoItemName = strlwr (_TextureNoItemName);
_TextureNoItemName = toLower((const char *) prop);
_TextureNoItemId = -2;
}

View file

@ -95,8 +95,7 @@ bool CViewRadar::parse(xmlNodePtr cur, CInterfaceGroup * parentGroup)
prop = (char*) xmlGetProp( cur, (xmlChar*)spotTextureNames[i] );
if (prop)
{
txName = (const char *) prop;
txName = strlwr (txName);
txName = toLower((const char *) prop);
}
_SpotDescriptions[i].TextureId.setTexture(txName.c_str());
rVR.getTextureSizeFromId (_SpotDescriptions[i].TextureId, _SpotDescriptions[i].TxW, _SpotDescriptions[i].TxH);
@ -105,8 +104,7 @@ bool CViewRadar::parse(xmlNodePtr cur, CInterfaceGroup * parentGroup)
prop = (char*) xmlGetProp( cur, (xmlChar*)spotMiniTextureNames[i] );
if (prop)
{
txName = (const char *) prop;
txName = strlwr (txName);
txName = toLower((const char *) prop);
}
_SpotDescriptions[i].MiniTextureId.setTexture(txName.c_str());
rVR.getTextureSizeFromId (_SpotDescriptions[i].MiniTextureId, _SpotDescriptions[i].MTxW, _SpotDescriptions[i].MTxH);

View file

@ -108,7 +108,7 @@ void CMeshCameraColManager::instanceGroupAdded(NL3D::UInstanceGroup *ig)
bool avoidCollisionInside= ig->dontCastShadowForInterior(i);
bool avoidCollisionOutside= ig->dontCastShadowForExterior(i);
// very special patch for the matis serre (grrrrrrrrrrrrr)
avoidCollisionOutside= avoidCollisionOutside || strlwr(shapeName)== "ma_serre_interieur.shape";
avoidCollisionOutside= avoidCollisionOutside || toLower(shapeName)== "ma_serre_interieur.shape";
// then send the result to the collision manager, and keep the mesh col id if succeed
uint32 meshId= CollisionManager->addMeshInstanceCollision(colMesh, mat, avoidCollisionInside, avoidCollisionOutside);

View file

@ -692,7 +692,7 @@ void CInterfaceChatDisplayer::displayChat(TDataSetIndex compressedSenderIndex, c
if (!stringCategory.empty() && stringCategory != "SYS")
{
map<string, CClientConfig::SSysInfoParam>::const_iterator it;
it = ClientCfg.SystemInfoParams.find(strlwr(stringCategory));
it = ClientCfg.SystemInfoParams.find(toLower(stringCategory));
if (it != ClientCfg.SystemInfoParams.end())
{
col = it->second.Color;
@ -723,7 +723,7 @@ void CInterfaceChatDisplayer::displayChat(TDataSetIndex compressedSenderIndex, c
if( !stringCategory.empty() )
{
map<string, CClientConfig::SSysInfoParam>::const_iterator it;
it = ClientCfg.SystemInfoParams.find( strlwr(stringCategory) );
it = ClientCfg.SystemInfoParams.find( toLower(stringCategory) );
if( it != ClientCfg.SystemInfoParams.end() )
{
if( !(*it).second.SysInfoFxName.empty() )

View file

@ -99,7 +99,7 @@ void COutpost::initOutpost ()
for (i=0; i<RZ_MAX_BUILDING_PER_OUTPOST; i++)
{
// Put the ZC pacs_prim
TPacsPrimMap::iterator pbIt = PacsPrims.find(NLMISC::strlwr(NLMISC::CFile::getFilenameWithoutExtension(ClientCfg.ZCPacsPrim)));
TPacsPrimMap::iterator pbIt = PacsPrims.find(NLMISC::toLower(NLMISC::CFile::getFilenameWithoutExtension(ClientCfg.ZCPacsPrim)));
if (pbIt != PacsPrims.end())
{
// Build the building matrix

View file

@ -142,7 +142,7 @@ UInstanceGroup *getCluster(const UGlobalPosition &gp)
if(strPos.empty())
return 0;
// try to find the ig in the loaded ig map
std::map<std::string, UInstanceGroup *>::const_iterator igIt = IGLoaded.find(strlwr(strPos));
std::map<std::string, UInstanceGroup *>::const_iterator igIt = IGLoaded.find(toLower(strPos));
if (igIt != IGLoaded.end())
{
return igIt->second;
@ -188,7 +188,7 @@ void releaseLandscapeIGCallbacks()
void addPacsPrim(const std::string &fileName)
{
std::string ppName = NLMISC::strlwr(NLMISC::CFile::getFilenameWithoutExtension(fileName));
std::string ppName = NLMISC::toLower(NLMISC::CFile::getFilenameWithoutExtension(fileName));
if (PacsPrims.find(ppName) != PacsPrims.end())
{
nlwarning(("Pacs primitive " + ppName + " already has been inserted").c_str());

View file

@ -281,7 +281,7 @@ CBitmap *buildSharedBitmap(const std::string &filename,
{
alreadyBuilt = false;
if (filename.empty()) return NULL;
std::string lcBMFilename = strlwr(CFile::getFilenameWithoutExtension(filename));
std::string lcBMFilename = toLower(CFile::getFilenameWithoutExtension(filename));
std::map<std::string, CBitmap *>::iterator it = bitmapByName.find(lcBMFilename);
if (it != bitmapByName.end())
{

View file

@ -291,10 +291,8 @@ bool CStreamableIG::setIG(uint ig, const std::string &name, const std::string &p
}
// Load this IG
_IGs[ig].Name = NLMISC::CFile::getFilenameWithoutExtension(name);
_IGs[ig].ParentName = NLMISC::CFile::getFilenameWithoutExtension(parentName);
NLMISC::strlwr(_IGs[ig].Name);
NLMISC::strlwr(_IGs[ig].ParentName);
_IGs[ig].Name = NLMISC::toLower(NLMISC::CFile::getFilenameWithoutExtension(name));
_IGs[ig].ParentName = NLMISC::toLower(NLMISC::CFile::getFilenameWithoutExtension(parentName));
_IGs[ig].IG = NULL;
_IGs[ig].Loading = false;
_Linked = false;
@ -308,10 +306,8 @@ void CStreamableIG::addIG(const std::string &name,const std::string &parentName,
{
H_AUTO_USE(RZ_StremableIG)
_IGs.push_back(CIGNode ());
_IGs.back().Name = NLMISC::CFile::getFilenameWithoutExtension(name);
_IGs.back().ParentName = NLMISC::CFile::getFilenameWithoutExtension(parentName);
NLMISC::strlwr(_IGs.back().Name);
NLMISC::strlwr(_IGs.back().ParentName);
_IGs.back().Name = NLMISC::toLower(NLMISC::CFile::getFilenameWithoutExtension(name));
_IGs.back().ParentName = NLMISC::toLower(NLMISC::CFile::getFilenameWithoutExtension(parentName));
_IGs.back().IG = NULL;
_IGs.back().Loading = false;
_IGs.back().Pos = pos;
@ -376,7 +372,7 @@ void CStreamableIG::addLoadedIGToMap()
if (_IGs[k].IG && _IGs[k].IG != (NL3D::UInstanceGroup *)-1) // is this a successfully loaded ig ?
{
// insert the new ig if it hasn't before..
if( _IGMap->insert(std::make_pair(NLMISC::strlwr(_IGs[k].Name), _IGs[k].IG)).second )
if( _IGMap->insert(std::make_pair(NLMISC::toLower(_IGs[k].Name), _IGs[k].IG)).second )
// if inserted, must notify IG Added, else already notifiyed by loadAsync()
this->notifyIGAdded(_IGs[k].IG);
}

View file

@ -1413,8 +1413,7 @@ const ucchar * CStringManagerClient::getSpecialWord(const std::string &label, bo
// avoid case problems
static std::string lwrLabel;
lwrLabel = label;
strlwr(lwrLabel);
lwrLabel = toLower(label);
if (_SpecItem_MemoryCompressed)
{
@ -1464,8 +1463,7 @@ const ucchar * CStringManagerClient::getSpecialDesc(const std::string &label)
// avoid case problems
static std::string lwrLabel;
lwrLabel= label;
strlwr(lwrLabel);
lwrLabel = toLower(label);
if (_SpecItem_MemoryCompressed)
{
@ -1498,8 +1496,7 @@ const ucchar * CStringManagerClient::getSpecialDesc2(const std::string &label)
// avoid case problems
static std::string lwrLabel;
lwrLabel= label;
strlwr(lwrLabel);
lwrLabel = toLower(label);
if (_SpecItem_MemoryCompressed)
{
@ -1703,8 +1700,7 @@ void CStringManagerClient::replaceSBrickName(NLMISC::CSheetId id, const ucstring
// avoid case problems
static std::string lwrLabel;
lwrLabel= label;
strlwr(lwrLabel);
lwrLabel = toLower(label);
if (_SpecItem_MemoryCompressed)
{

View file

@ -359,8 +359,7 @@ void CStaticFames::loadStaticFame( const string& filename )
// 1st, build the index table
for (uint i=1; i<ws.size(); ++i)
{
string name = ws.getData(i, 0).toString();
name = strlwr(name);
string name = toLower(ws.getData(i, 0).toString());
if (name.empty())
break;
_FactionNameIndex.insert(make_pair(CStringMapper::map(name), i-1));
@ -376,8 +375,7 @@ void CStaticFames::loadStaticFame( const string& filename )
// 2nd check the table structure
for (uint i=2; i<ws.ColCount; ++i)
{
string name = ws.getData(0, i).toString();
name = strlwr(name);
string name = toLower(ws.getData(0, i).toString());
if (name.empty())
{
@ -608,8 +606,7 @@ uint CStaticFames::getFactionIndex(NLMISC::TStringId factionName)
//----------------------------------------------------------------------------
uint CStaticFames::getFactionIndex(const std::string &factionName)
{
string n = strlwr(factionName);
return getFactionIndex(CStringMapper::map(n));
return getFactionIndex(CStringMapper::map(toLower(factionName)));
}
//----------------------------------------------------------------------------
@ -667,11 +664,7 @@ sint32 CStaticFames::getStaticFame(NLMISC::TStringId faction1, NLMISC::TStringId
//----------------------------------------------------------------------------
sint32 CStaticFames::getStaticFame(const std::string &faction1, const std::string &faction2)
{
string n1, n2;
n1 = strlwr(faction1);
n2 = strlwr(faction2);
return getStaticFame(CStringMapper::map(n1), CStringMapper::map(n2));
return getStaticFame(CStringMapper::map(toLower(faction1)), CStringMapper::map(toLower(faction2)));
}
//----------------------------------------------------------------------------

View file

@ -35,7 +35,7 @@ void CWeatherManager::init(const std::vector<const CWeatherSetupSheetBase *> &sh
{
if (sheets[k])
{
std::string id = NLMISC::strlwr(NLMISC::CFile::getFilenameWithoutExtension(sheetNames[k]));
std::string id = NLMISC::toLower(NLMISC::CFile::getFilenameWithoutExtension(sheetNames[k]));
CWeatherSetup *ws = newWeatherSetup();
if (ws)
{
@ -70,7 +70,7 @@ void CWeatherManager::release()
//================================================================================================
const CWeatherSetup *CWeatherManager::getSetup(const char *name) const
{
std::string id = NLMISC::strlwr(CFile::getFilenameWithoutExtension(name));
std::string id = NLMISC::toLower(CFile::getFilenameWithoutExtension(name));
TWeatherSetupMap::const_iterator it = _WeatherSetupMap.find(id);
if (it == _WeatherSetupMap.end()) return NULL;
return it->second;

View file

@ -85,7 +85,7 @@ void CWeatherStateSheet::build(const NLGEORGES::UFormElm &item)
GetWeatherFormValue(item, fxName, "FXName");
if (!fxName.empty())
{
fxName = NLMISC::strlwr(NLMISC::CFile::getFilenameWithoutExtension(fxName));
fxName = NLMISC::toLower(NLMISC::CFile::getFilenameWithoutExtension(fxName));
if (!fxName.empty())
{
FXInfos.resize(1);
@ -192,7 +192,7 @@ void CWeatherSetupSheetBase::build(const NLGEORGES::UFormElm &item)
CloudState.build(item);
std::string setupName;
GetWeatherFormValue(item, setupName, "SetupName");
SetupName = NLMISC::CStringMapper::map(NLMISC::strlwr(setupName));
SetupName = NLMISC::CStringMapper::map(NLMISC::toLower(setupName));
}
//==================================================================================
@ -203,7 +203,7 @@ void CWeatherSetupSheetBase::serial(class NLMISC::IStream &f) throw(NLMISC::EStr
{
std::string setupName;
f.serial(setupName);
SetupName = NLMISC::CStringMapper::map(NLMISC::strlwr(setupName));
SetupName = NLMISC::CStringMapper::map(NLMISC::toLower(setupName));
}
else
{