aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Util.cs
diff options
context:
space:
mode:
authorDiva Canto2010-11-29 08:43:33 -0800
committerDiva Canto2010-11-29 08:43:33 -0800
commitf86c438653fc3c8356a8f0c43a055b1928183f02 (patch)
treeb8ad05db04efde6385eeaed48dcbe4e896133ad5 /OpenSim/Framework/Util.cs
parentChanged the parser for InventoryItem deserialization. Moved some utility func... (diff)
downloadopensim-SC_OLD-f86c438653fc3c8356a8f0c43a055b1928183f02.zip
opensim-SC_OLD-f86c438653fc3c8356a8f0c43a055b1928183f02.tar.gz
opensim-SC_OLD-f86c438653fc3c8356a8f0c43a055b1928183f02.tar.bz2
opensim-SC_OLD-f86c438653fc3c8356a8f0c43a055b1928183f02.tar.xz
Preservation of creator information now also working in IARs. Cleaned up usage help. Moved Osp around, deleted unnecessary OspInventoryWrapperPlugin, added manipulation of SOP's xml representation in a generic ExternalRepresentationUtils function.
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Util.cs20
1 files changed, 20 insertions, 0 deletions
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index 101ece4..8d1671a 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -1558,6 +1558,16 @@ namespace OpenSim.Framework
1558 return string.Empty; 1558 return string.Empty;
1559 } 1559 }
1560 1560
1561 #region Xml Serialization Utilities
1562 public static bool ReadBoolean(XmlTextReader reader)
1563 {
1564 reader.ReadStartElement();
1565 bool result = Boolean.Parse(reader.ReadContentAsString().ToLower());
1566 reader.ReadEndElement();
1567
1568 return result;
1569 }
1570
1561 public static UUID ReadUUID(XmlTextReader reader, string name) 1571 public static UUID ReadUUID(XmlTextReader reader, string name)
1562 { 1572 {
1563 UUID id; 1573 UUID id;
@@ -1619,5 +1629,15 @@ namespace OpenSim.Framework
1619 return quat; 1629 return quat;
1620 } 1630 }
1621 1631
1632 public static T ReadEnum<T>(XmlTextReader reader, string name)
1633 {
1634 string value = reader.ReadElementContentAsString(name, String.Empty);
1635 // !!!!! to deal with flags without commas
1636 if (value.Contains(" ") && !value.Contains(","))
1637 value = value.Replace(" ", ", ");
1638
1639 return (T)Enum.Parse(typeof(T), value); ;
1640 }
1641 #endregion
1622 } 1642 }
1623} 1643}