mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 19:19:56 +00:00
Rename to lowerCaseInPlace
This commit is contained in:
parent
e3d3380c8c
commit
07b064f616
21 changed files with 39 additions and 48 deletions
|
@ -398,7 +398,7 @@ public:
|
||||||
virtual void read(ESM::ESMReader &esm)
|
virtual void read(ESM::ESMReader &esm)
|
||||||
{
|
{
|
||||||
std::string itemid = esm.getHNString("NAME");
|
std::string itemid = esm.getHNString("NAME");
|
||||||
Misc::StringUtils::toLower(itemid);
|
Misc::StringUtils::lowerCaseInPlace(itemid);
|
||||||
|
|
||||||
while (esm.isNextSub("FNAM") || esm.isNextSub("ONAM"))
|
while (esm.isNextSub("FNAM") || esm.isNextSub("ONAM"))
|
||||||
{
|
{
|
||||||
|
|
|
@ -846,7 +846,7 @@ void MwIniImporter::importGameFiles(multistrmap &cfg, const multistrmap &ini, co
|
||||||
|
|
||||||
for(std::vector<std::string>::const_iterator entry = it->second.begin(); entry!=it->second.end(); ++entry) {
|
for(std::vector<std::string>::const_iterator entry = it->second.begin(); entry!=it->second.end(); ++entry) {
|
||||||
std::string filetype(entry->substr(entry->length()-3));
|
std::string filetype(entry->substr(entry->length()-3));
|
||||||
Misc::StringUtils::toLower(filetype);
|
Misc::StringUtils::lowerCaseInPlace(filetype);
|
||||||
|
|
||||||
if(filetype.compare("esm") == 0 || filetype.compare("esp") == 0) {
|
if(filetype.compare("esm") == 0 || filetype.compare("esp") == 0) {
|
||||||
boost::filesystem::path filepath(gameFilesDir);
|
boost::filesystem::path filepath(gameFilesDir);
|
||||||
|
|
|
@ -93,7 +93,7 @@ void CSMWorld::CommandDispatcher::setEditLock (bool locked)
|
||||||
void CSMWorld::CommandDispatcher::setSelection (const std::vector<std::string>& selection)
|
void CSMWorld::CommandDispatcher::setSelection (const std::vector<std::string>& selection)
|
||||||
{
|
{
|
||||||
mSelection = selection;
|
mSelection = selection;
|
||||||
std::for_each (mSelection.begin(), mSelection.end(), Misc::StringUtils::toLowerStr);
|
std::for_each (mSelection.begin(), mSelection.end(), Misc::StringUtils::lowerCaseInPlace);
|
||||||
std::sort (mSelection.begin(), mSelection.end());
|
std::sort (mSelection.begin(), mSelection.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -168,7 +168,7 @@ void CSMWorld::RegionMap::updateRegions (const std::vector<std::string>& regions
|
||||||
{
|
{
|
||||||
std::vector<std::string> regions2 (regions);
|
std::vector<std::string> regions2 (regions);
|
||||||
|
|
||||||
std::for_each (regions2.begin(), regions2.end(), Misc::StringUtils::toLowerStr);
|
std::for_each (regions2.begin(), regions2.end(), Misc::StringUtils::lowerCaseInPlace);
|
||||||
std::sort (regions2.begin(), regions2.end());
|
std::sort (regions2.begin(), regions2.end());
|
||||||
|
|
||||||
for (std::map<CellCoordinates, CellDescription>::const_iterator iter (mMap.begin());
|
for (std::map<CellCoordinates, CellDescription>::const_iterator iter (mMap.begin());
|
||||||
|
|
|
@ -93,7 +93,7 @@ bool CSMWorld::ScriptContext::isId (const std::string& name) const
|
||||||
{
|
{
|
||||||
mIds = mData.getIds();
|
mIds = mData.getIds();
|
||||||
|
|
||||||
std::for_each (mIds.begin(), mIds.end(), &Misc::StringUtils::toLowerStr);
|
std::for_each (mIds.begin(), mIds.end(), &Misc::StringUtils::lowerCaseInPlace);
|
||||||
std::sort (mIds.begin(), mIds.end());
|
std::sort (mIds.begin(), mIds.end());
|
||||||
|
|
||||||
mIdsUpdated = true;
|
mIdsUpdated = true;
|
||||||
|
|
|
@ -148,11 +148,11 @@ namespace MWClass
|
||||||
|
|
||||||
// make key id lowercase
|
// make key id lowercase
|
||||||
std::string keyId = ptr.getCellRef().getKey();
|
std::string keyId = ptr.getCellRef().getKey();
|
||||||
Misc::StringUtils::toLower(keyId);
|
Misc::StringUtils::lowerCaseInPlace(keyId);
|
||||||
for (MWWorld::ContainerStoreIterator it = invStore.begin(); it != invStore.end(); ++it)
|
for (MWWorld::ContainerStoreIterator it = invStore.begin(); it != invStore.end(); ++it)
|
||||||
{
|
{
|
||||||
std::string refId = it->getCellRef().getRefId();
|
std::string refId = it->getCellRef().getRefId();
|
||||||
Misc::StringUtils::toLower(refId);
|
Misc::StringUtils::lowerCaseInPlace(refId);
|
||||||
if (refId == keyId)
|
if (refId == keyId)
|
||||||
{
|
{
|
||||||
hasKey = true;
|
hasKey = true;
|
||||||
|
|
|
@ -117,11 +117,11 @@ namespace MWClass
|
||||||
|
|
||||||
// make key id lowercase
|
// make key id lowercase
|
||||||
std::string keyId = ptr.getCellRef().getKey();
|
std::string keyId = ptr.getCellRef().getKey();
|
||||||
Misc::StringUtils::toLower(keyId);
|
Misc::StringUtils::lowerCaseInPlace(keyId);
|
||||||
for (MWWorld::ContainerStoreIterator it = invStore.begin(); it != invStore.end(); ++it)
|
for (MWWorld::ContainerStoreIterator it = invStore.begin(); it != invStore.end(); ++it)
|
||||||
{
|
{
|
||||||
std::string refId = it->getCellRef().getRefId();
|
std::string refId = it->getCellRef().getRefId();
|
||||||
Misc::StringUtils::toLower(refId);
|
Misc::StringUtils::lowerCaseInPlace(refId);
|
||||||
if (refId == keyId)
|
if (refId == keyId)
|
||||||
{
|
{
|
||||||
hasKey = true;
|
hasKey = true;
|
||||||
|
|
|
@ -129,7 +129,7 @@ namespace MWGui
|
||||||
size_t tagNameEndPos = tag.find(' ');
|
size_t tagNameEndPos = tag.find(' ');
|
||||||
mAttributes.clear();
|
mAttributes.clear();
|
||||||
mTag = tag.substr(0, tagNameEndPos);
|
mTag = tag.substr(0, tagNameEndPos);
|
||||||
Misc::StringUtils::toLower(mTag);
|
Misc::StringUtils::lowerCaseInPlace(mTag);
|
||||||
if (mTag.empty())
|
if (mTag.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -151,7 +151,7 @@ namespace MWGui
|
||||||
return;
|
return;
|
||||||
|
|
||||||
std::string key = tag.substr(0, sepPos);
|
std::string key = tag.substr(0, sepPos);
|
||||||
Misc::StringUtils::toLower(key);
|
Misc::StringUtils::lowerCaseInPlace(key);
|
||||||
tag.erase(0, sepPos+1);
|
tag.erase(0, sepPos+1);
|
||||||
|
|
||||||
std::string value;
|
std::string value;
|
||||||
|
|
|
@ -35,7 +35,7 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
const ESM::GameSetting ¤tSetting = *currentIteration;
|
const ESM::GameSetting ¤tSetting = *currentIteration;
|
||||||
std::string currentGMSTID = currentSetting.mId;
|
std::string currentGMSTID = currentSetting.mId;
|
||||||
Misc::StringUtils::toLower(currentGMSTID);
|
Misc::StringUtils::lowerCaseInPlace(currentGMSTID);
|
||||||
|
|
||||||
// Don't bother checking this GMST if it's not a sMagicBound* one.
|
// Don't bother checking this GMST if it's not a sMagicBound* one.
|
||||||
const std::string& toFind = "smagicbound";
|
const std::string& toFind = "smagicbound";
|
||||||
|
@ -44,7 +44,7 @@ namespace MWGui
|
||||||
|
|
||||||
// All sMagicBound* GMST's should be of type string
|
// All sMagicBound* GMST's should be of type string
|
||||||
std::string currentGMSTValue = currentSetting.getString();
|
std::string currentGMSTValue = currentSetting.getString();
|
||||||
Misc::StringUtils::toLower(currentGMSTValue);
|
Misc::StringUtils::lowerCaseInPlace(currentGMSTValue);
|
||||||
|
|
||||||
boundItemIDCache.insert(currentGMSTValue);
|
boundItemIDCache.insert(currentGMSTValue);
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@ namespace MWGui
|
||||||
|
|
||||||
// Perform bound item check and assign the Flag_Bound bit if it passes
|
// Perform bound item check and assign the Flag_Bound bit if it passes
|
||||||
std::string tempItemID = base.getCellRef().getRefId();
|
std::string tempItemID = base.getCellRef().getRefId();
|
||||||
Misc::StringUtils::toLower(tempItemID);
|
Misc::StringUtils::lowerCaseInPlace(tempItemID);
|
||||||
|
|
||||||
if (boundItemIDCache.count(tempItemID) != 0)
|
if (boundItemIDCache.count(tempItemID) != 0)
|
||||||
mFlags |= Flag_Bound;
|
mFlags |= Flag_Bound;
|
||||||
|
|
|
@ -132,15 +132,11 @@ namespace MWMechanics
|
||||||
return scaledDuration-usedUp;
|
return scaledDuration-usedUp;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ActiveSpells::isSpellActive(std::string id) const
|
bool ActiveSpells::isSpellActive(const std::string& id) const
|
||||||
{
|
{
|
||||||
Misc::StringUtils::toLower(id);
|
|
||||||
for (TContainer::iterator iter = mSpells.begin(); iter != mSpells.end(); ++iter)
|
for (TContainer::iterator iter = mSpells.begin(); iter != mSpells.end(); ++iter)
|
||||||
{
|
{
|
||||||
std::string left = iter->first;
|
if (Misc::StringUtils::ciEqual(iter->first, id))
|
||||||
Misc::StringUtils::toLower(left);
|
|
||||||
|
|
||||||
if (iter->first == id)
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -97,7 +97,7 @@ namespace MWMechanics
|
||||||
/// Remove all spells
|
/// Remove all spells
|
||||||
void clear();
|
void clear();
|
||||||
|
|
||||||
bool isSpellActive (std::string id) const;
|
bool isSpellActive (const std::string& id) const;
|
||||||
///< case insensitive
|
///< case insensitive
|
||||||
|
|
||||||
const MagicEffects& getMagicEffects() const;
|
const MagicEffects& getMagicEffects() const;
|
||||||
|
|
|
@ -604,7 +604,7 @@ namespace MWMechanics
|
||||||
int rank = 0;
|
int rank = 0;
|
||||||
std::string npcFaction = ptr.getClass().getPrimaryFaction(ptr);
|
std::string npcFaction = ptr.getClass().getPrimaryFaction(ptr);
|
||||||
|
|
||||||
Misc::StringUtils::toLower(npcFaction);
|
Misc::StringUtils::lowerCaseInPlace(npcFaction);
|
||||||
|
|
||||||
if (playerStats.getFactionRanks().find(npcFaction) != playerStats.getFactionRanks().end())
|
if (playerStats.getFactionRanks().find(npcFaction) != playerStats.getFactionRanks().end())
|
||||||
{
|
{
|
||||||
|
@ -1042,7 +1042,7 @@ namespace MWMechanics
|
||||||
owner.first = ownerCellRef->getFaction();
|
owner.first = ownerCellRef->getFaction();
|
||||||
owner.second = true;
|
owner.second = true;
|
||||||
}
|
}
|
||||||
Misc::StringUtils::toLower(owner.first);
|
Misc::StringUtils::lowerCaseInPlace(owner.first);
|
||||||
|
|
||||||
if (!Misc::StringUtils::ciEqual(item.getCellRef().getRefId(), MWWorld::ContainerStore::sGoldId))
|
if (!Misc::StringUtils::ciEqual(item.getCellRef().getRefId(), MWWorld::ContainerStore::sGoldId))
|
||||||
mStolenItems[Misc::StringUtils::lowerCase(item.getClass().getId(item))][owner] += count;
|
mStolenItems[Misc::StringUtils::lowerCase(item.getClass().getId(item))][owner] += count;
|
||||||
|
|
|
@ -390,7 +390,7 @@ namespace MWRender
|
||||||
void Animation::addAnimSource(const std::string &model)
|
void Animation::addAnimSource(const std::string &model)
|
||||||
{
|
{
|
||||||
std::string kfname = model;
|
std::string kfname = model;
|
||||||
Misc::StringUtils::toLower(kfname);
|
Misc::StringUtils::lowerCaseInPlace(kfname);
|
||||||
|
|
||||||
if(kfname.size() > 4 && kfname.compare(kfname.size()-4, 4, ".nif") == 0)
|
if(kfname.size() > 4 && kfname.compare(kfname.size()-4, 4, ".nif") == 0)
|
||||||
kfname.replace(kfname.size()-4, 4, ".kf");
|
kfname.replace(kfname.size()-4, 4, ".kf");
|
||||||
|
|
|
@ -123,7 +123,7 @@ namespace MWScript
|
||||||
const MWWorld::CellStore *cell = MWMechanics::getPlayer().getCell();
|
const MWWorld::CellStore *cell = MWMechanics::getPlayer().getCell();
|
||||||
|
|
||||||
std::string current = MWBase::Environment::get().getWorld()->getCellName(cell);
|
std::string current = MWBase::Environment::get().getWorld()->getCellName(cell);
|
||||||
Misc::StringUtils::toLower(current);
|
Misc::StringUtils::lowerCaseInPlace(current);
|
||||||
|
|
||||||
bool match = current.length()>=name.length() &&
|
bool match = current.length()>=name.length() &&
|
||||||
current.substr (0, name.length())==name;
|
current.substr (0, name.length())==name;
|
||||||
|
|
|
@ -116,7 +116,7 @@ namespace MWScript
|
||||||
virtual void execute (Interpreter::Runtime& runtime)
|
virtual void execute (Interpreter::Runtime& runtime)
|
||||||
{
|
{
|
||||||
std::string cell = (runtime.getStringLiteral (runtime[0].mInteger));
|
std::string cell = (runtime.getStringLiteral (runtime[0].mInteger));
|
||||||
::Misc::StringUtils::toLower(cell);
|
::Misc::StringUtils::lowerCaseInPlace(cell);
|
||||||
runtime.pop();
|
runtime.pop();
|
||||||
|
|
||||||
// "Will match complete or partial cells, so ShowMap, "Vivec" will show cells Vivec and Vivec, Fred's House as well."
|
// "Will match complete or partial cells, so ShowMap, "Vivec" will show cells Vivec and Vivec, Fred's House as well."
|
||||||
|
@ -129,7 +129,7 @@ namespace MWScript
|
||||||
for (; it != cells.extEnd(); ++it)
|
for (; it != cells.extEnd(); ++it)
|
||||||
{
|
{
|
||||||
std::string name = it->mName;
|
std::string name = it->mName;
|
||||||
::Misc::StringUtils::toLower(name);
|
::Misc::StringUtils::lowerCaseInPlace(name);
|
||||||
if (name.find(cell) != std::string::npos)
|
if (name.find(cell) != std::string::npos)
|
||||||
MWBase::Environment::get().getWindowManager()->addVisitedLocation (
|
MWBase::Environment::get().getWindowManager()->addVisitedLocation (
|
||||||
it->mName,
|
it->mName,
|
||||||
|
|
|
@ -543,7 +543,7 @@ namespace MWScript
|
||||||
factionID = runtime.getStringLiteral (runtime[0].mInteger);
|
factionID = runtime.getStringLiteral (runtime[0].mInteger);
|
||||||
runtime.pop();
|
runtime.pop();
|
||||||
}
|
}
|
||||||
::Misc::StringUtils::toLower(factionID);
|
::Misc::StringUtils::lowerCaseInPlace(factionID);
|
||||||
// Make sure this faction exists
|
// Make sure this faction exists
|
||||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Faction>().find(factionID);
|
MWBase::Environment::get().getWorld()->getStore().get<ESM::Faction>().find(factionID);
|
||||||
|
|
||||||
|
@ -575,7 +575,7 @@ namespace MWScript
|
||||||
factionID = runtime.getStringLiteral (runtime[0].mInteger);
|
factionID = runtime.getStringLiteral (runtime[0].mInteger);
|
||||||
runtime.pop();
|
runtime.pop();
|
||||||
}
|
}
|
||||||
::Misc::StringUtils::toLower(factionID);
|
::Misc::StringUtils::lowerCaseInPlace(factionID);
|
||||||
// Make sure this faction exists
|
// Make sure this faction exists
|
||||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Faction>().find(factionID);
|
MWBase::Environment::get().getWorld()->getStore().get<ESM::Faction>().find(factionID);
|
||||||
|
|
||||||
|
@ -614,7 +614,7 @@ namespace MWScript
|
||||||
factionID = runtime.getStringLiteral (runtime[0].mInteger);
|
factionID = runtime.getStringLiteral (runtime[0].mInteger);
|
||||||
runtime.pop();
|
runtime.pop();
|
||||||
}
|
}
|
||||||
::Misc::StringUtils::toLower(factionID);
|
::Misc::StringUtils::lowerCaseInPlace(factionID);
|
||||||
// Make sure this faction exists
|
// Make sure this faction exists
|
||||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Faction>().find(factionID);
|
MWBase::Environment::get().getWorld()->getStore().get<ESM::Faction>().find(factionID);
|
||||||
|
|
||||||
|
@ -645,7 +645,7 @@ namespace MWScript
|
||||||
{
|
{
|
||||||
factionID = ptr.getClass().getPrimaryFaction(ptr);
|
factionID = ptr.getClass().getPrimaryFaction(ptr);
|
||||||
}
|
}
|
||||||
::Misc::StringUtils::toLower(factionID);
|
::Misc::StringUtils::lowerCaseInPlace(factionID);
|
||||||
// Make sure this faction exists
|
// Make sure this faction exists
|
||||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Faction>().find(factionID);
|
MWBase::Environment::get().getWorld()->getStore().get<ESM::Faction>().find(factionID);
|
||||||
|
|
||||||
|
@ -756,7 +756,7 @@ namespace MWScript
|
||||||
if (factionId.empty())
|
if (factionId.empty())
|
||||||
throw std::runtime_error ("failed to determine faction");
|
throw std::runtime_error ("failed to determine faction");
|
||||||
|
|
||||||
::Misc::StringUtils::toLower (factionId);
|
::Misc::StringUtils::lowerCaseInPlace (factionId);
|
||||||
|
|
||||||
MWWorld::Ptr player = MWMechanics::getPlayer();
|
MWWorld::Ptr player = MWMechanics::getPlayer();
|
||||||
runtime.push (
|
runtime.push (
|
||||||
|
@ -791,7 +791,7 @@ namespace MWScript
|
||||||
if (factionId.empty())
|
if (factionId.empty())
|
||||||
throw std::runtime_error ("failed to determine faction");
|
throw std::runtime_error ("failed to determine faction");
|
||||||
|
|
||||||
::Misc::StringUtils::toLower (factionId);
|
::Misc::StringUtils::lowerCaseInPlace (factionId);
|
||||||
|
|
||||||
MWWorld::Ptr player = MWMechanics::getPlayer();
|
MWWorld::Ptr player = MWMechanics::getPlayer();
|
||||||
player.getClass().getNpcStats (player).setFactionReputation (factionId, value);
|
player.getClass().getNpcStats (player).setFactionReputation (factionId, value);
|
||||||
|
@ -825,7 +825,7 @@ namespace MWScript
|
||||||
if (factionId.empty())
|
if (factionId.empty())
|
||||||
throw std::runtime_error ("failed to determine faction");
|
throw std::runtime_error ("failed to determine faction");
|
||||||
|
|
||||||
::Misc::StringUtils::toLower (factionId);
|
::Misc::StringUtils::lowerCaseInPlace (factionId);
|
||||||
|
|
||||||
MWWorld::Ptr player = MWMechanics::getPlayer();
|
MWWorld::Ptr player = MWMechanics::getPlayer();
|
||||||
player.getClass().getNpcStats (player).setFactionReputation (factionId,
|
player.getClass().getNpcStats (player).setFactionReputation (factionId,
|
||||||
|
@ -870,11 +870,11 @@ namespace MWScript
|
||||||
MWWorld::Ptr ptr = R()(runtime);
|
MWWorld::Ptr ptr = R()(runtime);
|
||||||
|
|
||||||
std::string race = runtime.getStringLiteral(runtime[0].mInteger);
|
std::string race = runtime.getStringLiteral(runtime[0].mInteger);
|
||||||
::Misc::StringUtils::toLower(race);
|
::Misc::StringUtils::lowerCaseInPlace(race);
|
||||||
runtime.pop();
|
runtime.pop();
|
||||||
|
|
||||||
std::string npcRace = ptr.get<ESM::NPC>()->mBase->mRace;
|
std::string npcRace = ptr.get<ESM::NPC>()->mBase->mRace;
|
||||||
::Misc::StringUtils::toLower(npcRace);
|
::Misc::StringUtils::lowerCaseInPlace(npcRace);
|
||||||
|
|
||||||
runtime.push (npcRace == race);
|
runtime.push (npcRace == race);
|
||||||
}
|
}
|
||||||
|
@ -911,7 +911,7 @@ namespace MWScript
|
||||||
{
|
{
|
||||||
factionID = ptr.getClass().getPrimaryFaction(ptr);
|
factionID = ptr.getClass().getPrimaryFaction(ptr);
|
||||||
}
|
}
|
||||||
::Misc::StringUtils::toLower(factionID);
|
::Misc::StringUtils::lowerCaseInPlace(factionID);
|
||||||
MWWorld::Ptr player = MWMechanics::getPlayer();
|
MWWorld::Ptr player = MWMechanics::getPlayer();
|
||||||
if(factionID!="")
|
if(factionID!="")
|
||||||
{
|
{
|
||||||
|
|
|
@ -472,7 +472,7 @@ namespace MWWorld
|
||||||
|
|
||||||
void CellStore::loadRef (ESM::CellRef& ref, bool deleted, const ESMStore& store)
|
void CellStore::loadRef (ESM::CellRef& ref, bool deleted, const ESMStore& store)
|
||||||
{
|
{
|
||||||
Misc::StringUtils::toLower (ref.mRefID);
|
Misc::StringUtils::lowerCaseInPlace (ref.mRefID);
|
||||||
|
|
||||||
switch (store.find (ref.mRefID))
|
switch (store.find (ref.mRefID))
|
||||||
{
|
{
|
||||||
|
|
|
@ -96,7 +96,7 @@ namespace MWWorld
|
||||||
// This readRecord() method is used when reading a saved game.
|
// This readRecord() method is used when reading a saved game.
|
||||||
// Deleted globals can't appear there, so isDeleted will be ignored here.
|
// Deleted globals can't appear there, so isDeleted will be ignored here.
|
||||||
global.load(reader, isDeleted);
|
global.load(reader, isDeleted);
|
||||||
Misc::StringUtils::toLower(global.mId);
|
Misc::StringUtils::lowerCaseInPlace(global.mId);
|
||||||
|
|
||||||
Collection::iterator iter = mVariables.find (global.mId);
|
Collection::iterator iter = mVariables.find (global.mId);
|
||||||
if (iter!=mVariables.end())
|
if (iter!=mVariables.end())
|
||||||
|
|
|
@ -190,7 +190,7 @@ namespace MWWorld
|
||||||
bool isDeleted = false;
|
bool isDeleted = false;
|
||||||
|
|
||||||
record.load(esm, isDeleted);
|
record.load(esm, isDeleted);
|
||||||
Misc::StringUtils::toLower(record.mId);
|
Misc::StringUtils::lowerCaseInPlace(record.mId);
|
||||||
|
|
||||||
std::pair<typename Static::iterator, bool> inserted = mStatic.insert(std::make_pair(record.mId, record));
|
std::pair<typename Static::iterator, bool> inserted = mStatic.insert(std::make_pair(record.mId, record));
|
||||||
if (inserted.second)
|
if (inserted.second)
|
||||||
|
|
|
@ -51,7 +51,7 @@ std::string Misc::ResourceHelpers::correctResourcePath(const std::string &topLev
|
||||||
std::string prefix2 = topLevelDirectory + '/';
|
std::string prefix2 = topLevelDirectory + '/';
|
||||||
|
|
||||||
std::string correctedPath = resPath;
|
std::string correctedPath = resPath;
|
||||||
Misc::StringUtils::toLower(correctedPath);
|
Misc::StringUtils::lowerCaseInPlace(correctedPath);
|
||||||
|
|
||||||
// Apparently, leading separators are allowed
|
// Apparently, leading separators are allowed
|
||||||
while (correctedPath.size() && (correctedPath[0] == '/' || correctedPath[0] == '\\'))
|
while (correctedPath.size() && (correctedPath[0] == '/' || correctedPath[0] == '\\'))
|
||||||
|
|
|
@ -94,21 +94,16 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Transforms input string to lower case w/o copy
|
/// Transforms input string to lower case w/o copy
|
||||||
static void toLower(std::string &inout) {
|
static void lowerCaseInPlace(std::string &inout) {
|
||||||
for (unsigned int i=0; i<inout.size(); ++i)
|
for (unsigned int i=0; i<inout.size(); ++i)
|
||||||
inout[i] = toLower(inout[i]);
|
inout[i] = toLower(inout[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void toLowerStr(std::string &inout)
|
|
||||||
{
|
|
||||||
toLower(inout);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Returns lower case copy of input string
|
/// Returns lower case copy of input string
|
||||||
static std::string lowerCase(const std::string &in)
|
static std::string lowerCase(const std::string &in)
|
||||||
{
|
{
|
||||||
std::string out = in;
|
std::string out = in;
|
||||||
toLower(out);
|
lowerCaseInPlace(out);
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue