Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

skMSXMLElementObject.h

00001 /*
00002   Copyright 1996-2003
00003   Simon Whiteside
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Lesser General Public
00007     License as published by the Free Software Foundation; either
00008     version 2 of the License, or (at your option) any later version.
00009 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Lesser General Public License for more details.
00014 
00015     You should have received a copy of the GNU Lesser General Public
00016     License along with this library; if not, write to the Free Software
00017     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 
00019 * $Id: skMSXMLElementObject_8h-source.html,v 1.1 2003/04/14 15:53:25 simkin_cvs Exp $
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 // this is the value returned by executableType
00034 
00035 #define MSXMLELEMENT_TYPE 5
00036 
00037 /*
00038  * A stream operator for Strings
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);
00144   bool method(const skString& name,skRValueArray& args,skRValue& ret,skExecutableContext& ctxt);
00149   void copyItemsInto(XMLElement& other);
00153   virtual void setAddIfNotPresent(bool enable);
00157   virtual bool getAddIfNotPresent();
00162   XMLElement getElement();
00168   static skString getData(const XMLElement& element);
00174   static void setData(XMLElement& element,const skString& data);
00181   static XMLElement findChild(XMLElement& parent,const skString& tagname);
00188   static XMLElement findChild(XMLElement& parent,int index);
00197   static XMLElement findChild(XMLElement& parent,const skString& tagname,const skString& attribute,const skString& value);
00201   void setAttribute(skString name,const skString& value);
00206   skString getAttribute(const skString& name);
00210   static skString getAttribute(XMLElement& elem,const skString& name);
00214   static skString toString(_bstr_t& str);
00218   static _bstr_t fromString(const skString& str);
00222   skString getLocation() const;
00224   static int countChildren(XMLElement& parent);
00229   void save(ostream& out);
00233   virtual skString getSource(const skString& location);
00238   virtual void getInstanceVariables(skRValueTable& table);
00243   virtual void getAttributes(skRValueTable& table);
00244  protected:
00249   virtual void setElement(XMLElement& element);
00255   virtual skMSXMLElementObject * createXMLElementObject(const skString& location,XMLElement& element);
00259   skString m_ScriptLocation;
00264   skExecutableIterator * createIterator(const skString& qualifier);
00268   skExecutableIterator * createIterator();
00269  private:
00273   XMLElement m_Element;
00277   skMethodTable * m_MethodCache;
00281   skMSXMLElementObject(const skMSXMLElementObject&);
00285   skMSXMLElementObject& operator=(const skMSXMLElementObject&);
00290   bool m_AddIfNotPresent;
00291 
00292 };
00293 
00294 #endif

Generated on Mon Apr 14 16:49:22 2003 for Simkin C++ for Windows CE by doxygen1.3