00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef skMSXMLELEMENTOBJECT_H
00024 #define skMSXMLELEMENTOBJECT_H
00025
00026 #include "msxmldefs.h"
00027
00028 #include "skExecutable.h"
00029 #include <iostream.h>
00030
00031 class skMethodTable;
00032
00033
00034
00035 #define MSXMLELEMENT_TYPE 5
00036
00037
00038
00039
00040 CLASSEXPORT extern ostream& operator<< (ostream& target, const _bstr_t & s);
00041
00058 class CLASSEXPORT skMSXMLElementObject : public skExecutable {
00059 public:
00063 skMSXMLElementObject();
00069 skMSXMLElementObject(const skString& location,XMLElement& elem);
00073 ~skMSXMLElementObject();
00078 int executableType() const;
00082 int intValue() const;
00083 #ifdef USE_FLOATING_POINT
00084
00087 float floatValue() const;
00088 #endif
00089
00092 bool boolValue() const;
00096 Char charValue() const;
00100 skString strValue() const;
00108 bool setValue(const skString& name,const skString& attribute,const skRValue& return_value);
00116 bool setValueAt(const skRValue& array_index,const skString& attribute,const skRValue& value);
00126 bool getValue(const skString& name,const skString& attribute,skRValue& return_value);
00131 bool getValueAt(const skRValue& array_index,const skString& attribute,skRValue& value);
00146 bool method(const skString& name,skRValueArray& args,skRValue& ret,skExecutableContext& ctxt);
00151 void copyItemsInto(XMLElement& other);
00155 virtual void setAddIfNotPresent(bool enable);
00159 virtual bool getAddIfNotPresent();
00164 XMLElement getElement();
00170 static skString getData(const XMLElement& element);
00176 static void setData(XMLElement& element,const skString& data);
00183 static XMLElement findChild(XMLElement& parent,const skString& tagname);
00190 static XMLElement findChild(XMLElement& parent,int index);
00199 static XMLElement findChild(XMLElement& parent,const skString& tagname,const skString& attribute,const skString& value);
00203 void setAttribute(skString name,const skString& value);
00208 skString getAttribute(const skString& name);
00212 static skString getAttribute(XMLElement& elem,const skString& name);
00216 static skString toString(_bstr_t& str);
00220 static _bstr_t fromString(const skString& str);
00224 skString getLocation() const;
00226 static int countChildren(XMLElement& parent);
00231 void save(ostream& out);
00235 virtual skString getSource(const skString& location);
00240 virtual void getInstanceVariables(skRValueTable& table);
00245 virtual void getAttributes(skRValueTable& table);
00246 protected:
00251 virtual void setElement(XMLElement& element);
00257 virtual skMSXMLElementObject * createXMLElementObject(const skString& location,XMLElement& element);
00261 skString m_ScriptLocation;
00266 skExecutableIterator * createIterator(const skString& qualifier);
00270 skExecutableIterator * createIterator();
00271 private:
00275 XMLElement m_Element;
00279 skMethodTable * m_MethodCache;
00283 skMSXMLElementObject(const skMSXMLElementObject&);
00287 skMSXMLElementObject& operator=(const skMSXMLElementObject&);
00292 bool m_AddIfNotPresent;
00293
00294 };
00295
00296 #endif