summaryrefslogtreecommitdiff
path: root/indra/llxml/llcontrol.cpp
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2016-03-23 11:50:39 -0400
committerOz Linden <oz@lindenlab.com>2016-03-23 11:50:39 -0400
commit518f92126f18d5f4b8ee8eb287500fe5a7e17c99 (patch)
tree5d58fc3ba9ec7e0f6097b0644ec65fbbebd9cfbc /indra/llxml/llcontrol.cpp
parent7bbf2ec9f82c9818d02493c7b877e68ca97261fc (diff)
improve settings error log, and make type conversion methods static
Diffstat (limited to 'indra/llxml/llcontrol.cpp')
-rw-r--r--indra/llxml/llcontrol.cpp43
1 files changed, 23 insertions, 20 deletions
diff --git a/indra/llxml/llcontrol.cpp b/indra/llxml/llcontrol.cpp
index 4e3d0ab392..20ab1a7ad3 100644
--- a/indra/llxml/llcontrol.cpp
+++ b/indra/llxml/llcontrol.cpp
@@ -334,20 +334,23 @@ LLPointer<LLControlVariable> LLControlGroup::getControl(const std::string& name)
////////////////////////////////////////////////////////////////////////////
+// Must match the type definition in llcontrol.h
+const std::string LLControlGroup::mTypeString[TYPE_COUNT] = { "U32"
+ ,"S32"
+ ,"F32"
+ ,"Boolean"
+ ,"String"
+ ,"Vector3"
+ ,"Vector3D"
+ ,"Rect"
+ ,"Color4"
+ ,"Color3"
+ ,"LLSD"
+ };
+
LLControlGroup::LLControlGroup(const std::string& name)
: LLInstanceTracker<LLControlGroup, std::string>(name)
{
- mTypeString[TYPE_U32] = "U32";
- mTypeString[TYPE_S32] = "S32";
- mTypeString[TYPE_F32] = "F32";
- mTypeString[TYPE_BOOLEAN] = "Boolean";
- mTypeString[TYPE_STRING] = "String";
- mTypeString[TYPE_VEC3] = "Vector3";
- mTypeString[TYPE_VEC3D] = "Vector3D";
- mTypeString[TYPE_RECT] = "Rect";
- mTypeString[TYPE_COL4] = "Color4";
- mTypeString[TYPE_COL3] = "Color3";
- mTypeString[TYPE_LLSD] = "LLSD";
}
LLControlGroup::~LLControlGroup()
@@ -1170,7 +1173,7 @@ bool convert_from_llsd<bool>(const LLSD& sd, eControlType type, const std::strin
return sd.asBoolean();
else
{
- CONTROL_ERRS << "Invalid BOOL value for " << control_name << ": " << sd << LL_ENDL;
+ CONTROL_ERRS << "Invalid BOOL value for " << control_name << ": " << LLControlGroup::typeEnumToString(type) << " " << sd << LL_ENDL;
return FALSE;
}
}
@@ -1182,7 +1185,7 @@ S32 convert_from_llsd<S32>(const LLSD& sd, eControlType type, const std::string&
return sd.asInteger();
else
{
- CONTROL_ERRS << "Invalid S32 value for " << control_name << ": " << sd << LL_ENDL;
+ CONTROL_ERRS << "Invalid S32 value for " << control_name << ": " << LLControlGroup::typeEnumToString(type) << " " << sd << LL_ENDL;
return 0;
}
}
@@ -1194,7 +1197,7 @@ U32 convert_from_llsd<U32>(const LLSD& sd, eControlType type, const std::string&
return sd.asInteger();
else
{
- CONTROL_ERRS << "Invalid U32 value for " << control_name << ": " << sd << LL_ENDL;
+ CONTROL_ERRS << "Invalid U32 value for " << control_name << ": " << LLControlGroup::typeEnumToString(type) << " " << sd << LL_ENDL;
return 0;
}
}
@@ -1206,7 +1209,7 @@ F32 convert_from_llsd<F32>(const LLSD& sd, eControlType type, const std::string&
return (F32) sd.asReal();
else
{
- CONTROL_ERRS << "Invalid F32 value for " << control_name << ": " << sd << LL_ENDL;
+ CONTROL_ERRS << "Invalid F32 value for " << control_name << ": " << LLControlGroup::typeEnumToString(type) << " " << sd << LL_ENDL;
return 0.0f;
}
}
@@ -1218,7 +1221,7 @@ std::string convert_from_llsd<std::string>(const LLSD& sd, eControlType type, co
return sd.asString();
else
{
- CONTROL_ERRS << "Invalid string value for " << control_name << ": " << sd << LL_ENDL;
+ CONTROL_ERRS << "Invalid string value for " << control_name << ": " << LLControlGroup::typeEnumToString(type) << " " << sd << LL_ENDL;
return LLStringUtil::null;
}
}
@@ -1236,7 +1239,7 @@ LLVector3 convert_from_llsd<LLVector3>(const LLSD& sd, eControlType type, const
return (LLVector3)sd;
else
{
- CONTROL_ERRS << "Invalid LLVector3 value for " << control_name << ": " << sd << LL_ENDL;
+ CONTROL_ERRS << "Invalid LLVector3 value for " << control_name << ": " << LLControlGroup::typeEnumToString(type) << " " << sd << LL_ENDL;
return LLVector3::zero;
}
}
@@ -1248,7 +1251,7 @@ LLVector3d convert_from_llsd<LLVector3d>(const LLSD& sd, eControlType type, cons
return (LLVector3d)sd;
else
{
- CONTROL_ERRS << "Invalid LLVector3d value for " << control_name << ": " << sd << LL_ENDL;
+ CONTROL_ERRS << "Invalid LLVector3d value for " << control_name << ": " << LLControlGroup::typeEnumToString(type) << " " << sd << LL_ENDL;
return LLVector3d::zero;
}
}
@@ -1260,7 +1263,7 @@ LLRect convert_from_llsd<LLRect>(const LLSD& sd, eControlType type, const std::s
return LLRect(sd);
else
{
- CONTROL_ERRS << "Invalid rect value for " << control_name << ": " << sd << LL_ENDL;
+ CONTROL_ERRS << "Invalid rect value for " << control_name << ": " << LLControlGroup::typeEnumToString(type) << " " << sd << LL_ENDL;
return LLRect::null;
}
}
@@ -1305,7 +1308,7 @@ LLColor3 convert_from_llsd<LLColor3>(const LLSD& sd, eControlType type, const st
return sd;
else
{
- CONTROL_ERRS << "Invalid LLColor3 value for " << control_name << ": " << sd << LL_ENDL;
+ CONTROL_ERRS << "Invalid LLColor3 value for " << control_name << ": " << LLControlGroup::typeEnumToString(type) << " " << sd << LL_ENDL;
return LLColor3::white;
}
}