No need to build strings.

pull/3375/head
Malcolm Tyrrell 2020-08-18 18:21:20 +01:00
parent e1a0163e7e
commit 0f6127e90e
5 changed files with 19 additions and 19 deletions

View File

@ -147,11 +147,11 @@ void AMFImporter::Throw_CloseNotFound(const std::string &pNode) {
}
void AMFImporter::Throw_IncorrectAttr(const std::string &pAttrName) {
throw DeadlyImportError("Node <", std::string(mReader->getNodeName()), "> has incorrect attribute \"", pAttrName, "\".");
throw DeadlyImportError("Node <", mReader->getNodeName(), "> has incorrect attribute \"", pAttrName, "\".");
}
void AMFImporter::Throw_IncorrectAttrValue(const std::string &pAttrName) {
throw DeadlyImportError("Attribute \"", pAttrName, "\" in node <", std::string(mReader->getNodeName()), "> has incorrect value.");
throw DeadlyImportError("Attribute \"", pAttrName, "\" in node <", mReader->getNodeName(), "> has incorrect value.");
}
void AMFImporter::Throw_MoreThanOnceDefined(const std::string &pNodeType, const std::string &pDescription) {

View File

@ -59,9 +59,9 @@ namespace Ogre {
AI_WONT_RETURN void ThrowAttibuteError(const XmlReader *reader, const std::string &name, const std::string &error = "") AI_WONT_RETURN_SUFFIX;
AI_WONT_RETURN void ThrowAttibuteError(const XmlReader *reader, const std::string &name, const std::string &error) {
if (!error.empty()) {
throw DeadlyImportError(error, " in node '", std::string(reader->getNodeName()), "' and attribute '", name, "'");
throw DeadlyImportError(error, " in node '", reader->getNodeName(), "' and attribute '", name, "'");
} else {
throw DeadlyImportError("Attribute '", name, "' does not exist in node '", std::string(reader->getNodeName()), "'");
throw DeadlyImportError("Attribute '", name, "' does not exist in node '", reader->getNodeName(), "'");
}
}

View File

@ -243,23 +243,23 @@ void X3DImporter::Throw_CloseNotFound(const std::string& pNode)
void X3DImporter::Throw_ConvertFail_Str2ArrF(const std::string& pAttrValue)
{
throw DeadlyImportError("In <", std::string(mReader->getNodeName()), "> failed to convert attribute value \"", pAttrValue,
throw DeadlyImportError("In <", mReader->getNodeName(), "> failed to convert attribute value \"", pAttrValue,
"\" from string to array of floats.");
}
void X3DImporter::Throw_DEF_And_USE()
{
throw DeadlyImportError("\"DEF\" and \"USE\" can not be defined both in <", std::string(mReader->getNodeName()), ">.");
throw DeadlyImportError("\"DEF\" and \"USE\" can not be defined both in <", mReader->getNodeName(), ">.");
}
void X3DImporter::Throw_IncorrectAttr(const std::string& pAttrName)
{
throw DeadlyImportError("Node <", std::string(mReader->getNodeName()), "> has incorrect attribute \"", pAttrName, "\".");
throw DeadlyImportError("Node <", mReader->getNodeName(), "> has incorrect attribute \"", pAttrName, "\".");
}
void X3DImporter::Throw_IncorrectAttrValue(const std::string& pAttrName)
{
throw DeadlyImportError("Attribute \"", pAttrName, "\" in node <", std::string(mReader->getNodeName()), "> has incorrect value.");
throw DeadlyImportError("Attribute \"", pAttrName, "\" in node <", mReader->getNodeName(), "> has incorrect value.");
}
void X3DImporter::Throw_MoreThanOnceDefined(const std::string& pNodeType, const std::string& pDescription)
@ -274,7 +274,7 @@ void X3DImporter::Throw_TagCountIncorrect(const std::string& pNode)
void X3DImporter::Throw_USE_NotFound(const std::string& pAttrValue)
{
throw DeadlyImportError("Not found node with name \"", pAttrValue, "\" in <", std::string(mReader->getNodeName()), ">.");
throw DeadlyImportError("Not found node with name \"", pAttrValue, "\" in <", mReader->getNodeName(), ">.");
}
/*********************************************************************************************************************************************/
@ -1519,7 +1519,7 @@ void X3DImporter::ParseNode_Scene()
auto GroupCounter_Increase = [](size_t& pCounter, const char* pGroupName) -> void
{
pCounter++;
if(pCounter == 0) throw DeadlyImportError("Group counter overflow. Too much groups with type: ", std::string(pGroupName), ".");
if(pCounter == 0) throw DeadlyImportError("Group counter overflow. Too much groups with type: ", pGroupName, ".");
};
auto GroupCounter_Decrease = [&](size_t& pCounter, const char* pGroupName) -> void

View File

@ -235,15 +235,15 @@ Ref<T> LazyDict<T>::Get(const char *id) {
// read it from the JSON object
if (!mDict) {
throw DeadlyImportError("GLTF: Missing section \"", std::string(mDictId), "\"");
throw DeadlyImportError("GLTF: Missing section \"", mDictId, "\"");
}
Value::MemberIterator obj = mDict->FindMember(id);
if (obj == mDict->MemberEnd()) {
throw DeadlyImportError("GLTF: Missing object with id \"", std::string(id), "\" in \"", mDictId, "\"");
throw DeadlyImportError("GLTF: Missing object with id \"", id, "\" in \"", mDictId, "\"");
}
if (!obj->value.IsObject()) {
throw DeadlyImportError("GLTF: Object with id \"", std::string(id), "\" is not a JSON object");
throw DeadlyImportError("GLTF: Object with id \"", id, "\" is not a JSON object");
}
// create an instance of the given type
@ -339,9 +339,9 @@ inline void Buffer::Read(Value &obj, Asset &r) {
delete file;
if (!ok)
throw DeadlyImportError("GLTF: error while reading referenced file \"", std::string(uri), "\"");
throw DeadlyImportError("GLTF: error while reading referenced file \"", uri, "\"");
} else {
throw DeadlyImportError("GLTF: could not open referenced file \"", std::string(uri), "\"");
throw DeadlyImportError("GLTF: could not open referenced file \"", uri, "\"");
}
}
}

View File

@ -269,11 +269,11 @@ Ref<T> LazyDict<T>::Retrieve(unsigned int i) {
// read it from the JSON object
if (!mDict) {
throw DeadlyImportError("GLTF: Missing section \"", std::string(mDictId), "\"");
throw DeadlyImportError("GLTF: Missing section \"", mDictId, "\"");
}
if (!mDict->IsArray()) {
throw DeadlyImportError("GLTF: Field is not an array \"", std::string(mDictId), "\"");
throw DeadlyImportError("GLTF: Field is not an array \"", mDictId, "\"");
}
Value &obj = (*mDict)[i];
@ -403,9 +403,9 @@ inline void Buffer::Read(Value &obj, Asset &r) {
delete file;
if (!ok)
throw DeadlyImportError("GLTF: error while reading referenced file \"", std::string(uri), "\"");
throw DeadlyImportError("GLTF: error while reading referenced file \"", uri, "\"");
} else {
throw DeadlyImportError("GLTF: could not open referenced file \"", std::string(uri), "\"");
throw DeadlyImportError("GLTF: could not open referenced file \"", uri, "\"");
}
}
}