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

This commit is contained in:
kervala 2011-06-05 17:52:40 +02:00
parent 16ea78ecb3
commit 73b6bee421
17 changed files with 59 additions and 66 deletions

View file

@ -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< pair<string,str
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);
string tmp2 = allparam.substr(e+1,p-e-1);

View file

@ -1684,7 +1684,7 @@ void CBotChatPageTrade::setupFactionPointPrice(bool /* sellMode */, uint default
// setup icon according to pvp clan
CInterfaceManager *pIM= CInterfaceManager::getInstance();
strlwr(factionName);
factionName = NLMISC::toLower(factionName);
string factionIcon= pIM->getDefine(toString("faction_icon_%s", factionName.c_str()));
CViewBitmap *vBmp= dynamic_cast<CViewBitmap*>(fpGroup->getView("unit_price:item_price:icone"));
if(vBmp) vBmp->setTexture(factionIcon);

View file

@ -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)

View file

@ -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");

View file

@ -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);
}

View file

@ -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;

View file

@ -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

View file

@ -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"

View file

@ -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"

View file

@ -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; k<fileNames.size(); ++k)
{
// check extension
if (strlwr(CFile::getExtension(fileNames[k])) != "pacs_prim")
if (NLMISC::toLower(CFile::getExtension(fileNames[k])) != "pacs_prim")
{
// not a pacs primitive, skip it..
continue;
}
try
{
string ppName = strlwr(CFile::getFilenameWithoutExtension(fileNames[k]));
string ppName = NLMISC::toLower(CFile::getFilenameWithoutExtension(fileNames[k]));
if (_PacsPrimMap.find(ppName) != _PacsPrimMap.end())
continue;
@ -348,8 +348,8 @@ void CContinentContainer::loadPacsPrims(const CSheet &sheet, NLPACS::UMoveContai
{
TPacsPrimMap::iterator pbIt;
string shapeName = strlwr(CFile::getFilenameWithoutExtension(igLoader.getShapeName(k)));
string instanceName = strlwr(CFile::getFilenameWithoutExtension(igLoader.getInstanceName(k)));
string shapeName = NLMISC::toLower(CFile::getFilenameWithoutExtension(igLoader.getShapeName(k)));
string instanceName = NLMISC::toLower(CFile::getFilenameWithoutExtension(igLoader.getInstanceName(k)));
bool isTrigger = false;
bool isZC = false;

View file

@ -1850,15 +1850,15 @@ void CMissionData::parseMissionHeader(NLLIGO::IPrimitive *prim)
else if (s == "guild")
_Guild = true;
_NotInJournal = strlwr(getProperty(prim, "not_in_journal", false, false)) == "true";
_AutoRemoveFromJournal = strlwr(getProperty(prim, "auto_remove_from_journal", false, false)) == "true";
_NotInJournal = NLMISC::toLower(getProperty(prim, "not_in_journal", false, false)) == "true";
_AutoRemoveFromJournal = NLMISC::toLower(getProperty(prim, "auto_remove_from_journal", false, false)) == "true";
_MissionCategory = getProperty(prim, "mission_category", false, false);
_PlayerReplayTimer = atoi(getProperty(prim, "player_replay_timer", true, false).c_str());
_GlobalReplayTimer = atoi(getProperty(prim, "global_replay_timer", true, false).c_str());
_NotProposed = strlwr(getProperty(prim, "not_proposed", false, false)) == "true";
_MissionAuto = strlwr(getProperty(prim, "automatic", false, false)) == "true";
_NonAbandonnable = strlwr(getProperty(prim, "non_abandonnable", false, false)) == "true";
_FailIfInventoryIsFull = strlwr(getProperty(prim, "fail_if_inventory_is_full", false, false)) == "true";
NLMISC::fromString(getProperty(prim, "player_replay_timer", true, false), _PlayerReplayTimer);
NLMISC::fromString(getProperty(prim, "global_replay_timer", true, false), _GlobalReplayTimer);
_NotProposed = NLMISC::toLower(getProperty(prim, "not_proposed", false, false)) == "true";
_MissionAuto = NLMISC::toLower(getProperty(prim, "automatic", false, false)) == "true";
_NonAbandonnable = NLMISC::toLower(getProperty(prim, "non_abandonnable", false, false)) == "true";
_FailIfInventoryIsFull = NLMISC::toLower(getProperty(prim, "fail_if_inventory_is_full", false, false)) == "true";
_MissionIcon = getProperty(prim, "mission_icon", false, false);
if (_MissionAuto)

View file

@ -373,7 +373,7 @@ public:
string s;
s = md.getProperty(prim, "hide_others", true, false);
_HideOthers = (strlwr(s) == "true");
_HideOthers = (NLMISC::toLower(s) == "true");
}
string genCode(CMissionData &md)
@ -673,7 +673,7 @@ public:
string s;
s = md.getProperty(prim, "group", true, false);
_Group = (strlwr(s) == "true");
_Group = (NLMISC::toLower(s) == "true");
IStepContent::init(md, prim);
@ -741,7 +741,7 @@ public:
string s;
s = md.getProperty(prim, "group", true, false);
_Group = (strlwr(s) == "true");
_Group = (NLMISC::toLower(s) == "true");
IStepContent::init(md, prim);
}
@ -908,7 +908,7 @@ public:
string s;
s = md.getProperty(prim, "group", true, false);
_Group = (strlwr(s) == "true");
_Group = (NLMISC::toLower(s) == "true");
IStepContent::init(md, prim);
}
@ -965,7 +965,7 @@ public:
string s;
s = md.getProperty(prim, "group", true, false);
_Group = (strlwr(s) == "true");
_Group = (NLMISC::toLower(s) == "true");
IStepContent::init(md, prim);
}
@ -1114,7 +1114,7 @@ public:
_WorldPosition = md.getProperty(prim, "world_position", true, false);
string s;
prim->getPropertyByName("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);
}

View file

@ -519,7 +519,7 @@ public:
formDate = 0;
// In the map ?
string formShortName = strlwr (CFile::getFilename (formName));
string formShortName = NLMISC::toLower(CFile::getFilename (formName));
map<string, CValue >::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<fileCount; i++)
{
// Primitive file ?
if (strlwr (CFile::getExtension (files[i])) == "primitive")
if (NLMISC::toLower(CFile::getExtension (files[i])) == "primitive")
{
// Progress bar
nlinfo (files[i].c_str());

View file

@ -87,8 +87,7 @@ void CAnimCombatState::build(const string &line)
void makeAnimMeleeImpact(const std::string &animSetFile, const set<CAnimCombatSet> &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<CAnimCombatSet>::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)

View file

@ -429,8 +429,8 @@ void CPackageDescription::buildDefaultFileList()
std::vector<std::string> fileList;
NLMISC::CPath::getPathContent(_BnpDirectory,false,false,true,fileList);
for (uint32 i=0;i<fileList.size();++i)
if (NLMISC::strlwr(NLMISC::CFile::getExtension(fileList[i]))=="bnp")
_Categories.addFile("main",NLMISC::strlwr(NLMISC::CFile::getFilename(fileList[i])));
if (NLMISC::toLower(NLMISC::CFile::getExtension(fileList[i]))=="bnp")
_Categories.addFile("main",NLMISC::toLower(NLMISC::CFile::getFilename(fileList[i])));
_Categories.addFile("unpacked","root.bnp");
}

View file

@ -96,16 +96,16 @@ string xmlSpecialChars(string str)
string getFullStdPathNoExt(const string &path)
{
string dir = strlwr(NLMISC::CFile::getPath(path));
string file = strlwr(NLMISC::CFile::getFilenameWithoutExtension(path));
string dir = NLMISC::toLower(NLMISC::CFile::getPath(path));
string file = NLMISC::toLower(NLMISC::CFile::getFilenameWithoutExtension(path));
return dir.empty() ? file : NLMISC::CPath::standardizePath(dir)+file;
}
string getFullStdPath(const string &path)
{
string dir = strlwr(NLMISC::CFile::getPath(path));
string file = strlwr(NLMISC::CFile::getFilename(path));
string dir = NLMISC::toLower(NLMISC::CFile::getPath(path));
string file = NLMISC::toLower(NLMISC::CFile::getFilename(path));
return dir.empty() ? file : NLMISC::CPath::standardizePath(dir)+file;
}
@ -255,7 +255,7 @@ bool CDbNode::epilog()
setEnv("db", Name);
string fullfile = getFullStdPathNoExt(MainFile.empty() ? Name : MainFile);
string filename = NLMISC::strlwr(NLMISC::CFile::getFilenameWithoutExtension(fullfile));
string filename = NLMISC::toLower(NLMISC::CFile::getFilenameWithoutExtension(fullfile));
setEnv("filename", filename);
setEnv("fullfilename", fullfile);
@ -785,14 +785,14 @@ void CDbNode::generateLogContent()
// get file path from this file
string CDbNode::getFileNoExtPath(const std::string& file)
{
string thisPath = NLMISC::CFile::getPath(strlwr(getDbFile()));
string filePath = NLMISC::CFile::getPath(strlwr(file));
string fileName = NLMISC::CFile::getFilename(strlwr(file));
string thisPath = NLMISC::CFile::getPath(NLMISC::toLower(getDbFile()));
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 CPath::standardizePath(filePath)+CFile::getFilenameWithoutExtension(strlwr(file));
return CPath::standardizePath(filePath)+CFile::getFilenameWithoutExtension(NLMISC::toLower(file));
}
@ -822,7 +822,7 @@ bool CFileNode::generateProlog()
if (!db->Description.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()

View file

@ -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;
}