using System;
using libsecondlife;
using libsecondlife.AssetSystem;
namespace libsecondlife.InventorySystem
{
///
/// Base class for Inventory items
///
abstract public class InventoryBase
{
protected InventoryManager iManager;
internal string _Name;
///
///
///
internal InventoryBase(InventoryManager manager)
{
if( manager == null )
{
throw new Exception( "Inventory Manager cannot be null" );
}
iManager = manager;
}
///
/// Output this item as XML
///
/// Include an asset data as well, TRUE/FALSE
abstract public string toXML(bool outputAssets);
///
/// Get a short string describing this item's type
///
abstract public string GetDisplayType();
///
/// Utility function to simply making text XML safe
///
///
protected string xmlSafe(string str)
{
if( str != null )
{
string clean = str.Replace("&","&");
clean = clean.Replace("<","<");
clean = clean.Replace(">",">");
clean = clean.Replace("'","'");
clean = clean.Replace("\"",""");
return clean;
}
else
{
return "";
}
}
}
}