summaryrefslogtreecommitdiff
path: root/indra/llxml
diff options
context:
space:
mode:
authorAndreyL ProductEngine <alihatskiy@productengine.com>2016-05-20 02:06:08 +0300
committerAndreyL ProductEngine <alihatskiy@productengine.com>2016-05-20 02:06:08 +0300
commitc50f96b49215b4279192ffc3eb336a3465a00756 (patch)
treeda923846a177ea97882dd0ba07b9235a5f0e7b8b /indra/llxml
parentd3de134da047460c68ffd7cc732e592049a1e83d (diff)
parentb25a22a2c113a1e95f2cd5d45bb5b80a756c4a80 (diff)
Merged in lindenlab/viewer-lynx
Diffstat (limited to 'indra/llxml')
-rw-r--r--[-rwxr-xr-x]indra/llxml/CMakeLists.txt0
-rw-r--r--[-rwxr-xr-x]indra/llxml/llcontrol.cpp43
-rw-r--r--[-rwxr-xr-x]indra/llxml/llcontrol.h7
-rw-r--r--[-rwxr-xr-x]indra/llxml/llcontrolgroupreader.h0
-rw-r--r--[-rwxr-xr-x]indra/llxml/llxmlnode.cpp0
-rw-r--r--[-rwxr-xr-x]indra/llxml/llxmlnode.h0
-rw-r--r--[-rwxr-xr-x]indra/llxml/llxmlparser.cpp0
-rw-r--r--[-rwxr-xr-x]indra/llxml/llxmlparser.h0
-rw-r--r--[-rwxr-xr-x]indra/llxml/llxmltree.cpp0
-rw-r--r--[-rwxr-xr-x]indra/llxml/llxmltree.h0
-rw-r--r--[-rwxr-xr-x]indra/llxml/tests/llcontrol_test.cpp0
11 files changed, 27 insertions, 23 deletions
diff --git a/indra/llxml/CMakeLists.txt b/indra/llxml/CMakeLists.txt
index 17400a203e..17400a203e 100755..100644
--- a/indra/llxml/CMakeLists.txt
+++ b/indra/llxml/CMakeLists.txt
diff --git a/indra/llxml/llcontrol.cpp b/indra/llxml/llcontrol.cpp
index 4e3d0ab392..20ab1a7ad3 100755..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;
}
}
diff --git a/indra/llxml/llcontrol.h b/indra/llxml/llcontrol.h
index 04575d81e0..77065dcf8d 100755..100644
--- a/indra/llxml/llcontrol.h
+++ b/indra/llxml/llcontrol.h
@@ -70,6 +70,7 @@ class LLVector3d;
class LLColor4;
class LLColor3;
+// if this is changed, also modify mTypeString in llcontrol.h
typedef enum e_control_type
{
TYPE_U32 = 0,
@@ -190,11 +191,11 @@ class LLControlGroup : public LLInstanceTracker<LLControlGroup, std::string>
protected:
typedef std::map<std::string, LLControlVariablePtr > ctrl_name_table_t;
ctrl_name_table_t mNameTable;
- std::string mTypeString[TYPE_COUNT];
+ static const std::string mTypeString[TYPE_COUNT];
public:
- eControlType typeStringToEnum(const std::string& typestr);
- std::string typeEnumToString(eControlType typeenum);
+ static eControlType typeStringToEnum(const std::string& typestr);
+ static std::string typeEnumToString(eControlType typeenum);
LLControlGroup(const std::string& name);
~LLControlGroup();
diff --git a/indra/llxml/llcontrolgroupreader.h b/indra/llxml/llcontrolgroupreader.h
index 6a27a65499..6a27a65499 100755..100644
--- a/indra/llxml/llcontrolgroupreader.h
+++ b/indra/llxml/llcontrolgroupreader.h
diff --git a/indra/llxml/llxmlnode.cpp b/indra/llxml/llxmlnode.cpp
index 455df13e48..455df13e48 100755..100644
--- a/indra/llxml/llxmlnode.cpp
+++ b/indra/llxml/llxmlnode.cpp
diff --git a/indra/llxml/llxmlnode.h b/indra/llxml/llxmlnode.h
index 0b8da5dc5d..0b8da5dc5d 100755..100644
--- a/indra/llxml/llxmlnode.h
+++ b/indra/llxml/llxmlnode.h
diff --git a/indra/llxml/llxmlparser.cpp b/indra/llxml/llxmlparser.cpp
index 1bdc283f67..1bdc283f67 100755..100644
--- a/indra/llxml/llxmlparser.cpp
+++ b/indra/llxml/llxmlparser.cpp
diff --git a/indra/llxml/llxmlparser.h b/indra/llxml/llxmlparser.h
index a5b210404f..a5b210404f 100755..100644
--- a/indra/llxml/llxmlparser.h
+++ b/indra/llxml/llxmlparser.h
diff --git a/indra/llxml/llxmltree.cpp b/indra/llxml/llxmltree.cpp
index ca98953f92..ca98953f92 100755..100644
--- a/indra/llxml/llxmltree.cpp
+++ b/indra/llxml/llxmltree.cpp
diff --git a/indra/llxml/llxmltree.h b/indra/llxml/llxmltree.h
index a82fee0416..a82fee0416 100755..100644
--- a/indra/llxml/llxmltree.h
+++ b/indra/llxml/llxmltree.h
diff --git a/indra/llxml/tests/llcontrol_test.cpp b/indra/llxml/tests/llcontrol_test.cpp
index 2b691ffbb1..2b691ffbb1 100755..100644
--- a/indra/llxml/tests/llcontrol_test.cpp
+++ b/indra/llxml/tests/llcontrol_test.cpp