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

skXMLElementObject.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: skXMLElementObject.h,v 1.39 2003/03/18 19:36:13 simkin_cvs Exp $
00020 */
00021 
00022 
00023 #ifndef skXMLELEMENTOBJECT_H
00024 #define skXMLELEMENTOBJECT_H
00025 
00026 #include "skExecutable.h"
00027 #include <xercesc/dom/deprecated/DOM_Element.hpp>
00028 #include <iostream.h>
00029 #include <xercesc/framework/XMLFormatter.hpp>
00030 
00031 class skMethodTable;
00032 
00033 // this is the value returned by executableType
00034 
00035 #define XMLELEMENT_TYPE 2
00036 
00037 /*
00038  * A stream operator for DOM_Nodes
00039  */
00040 //CLASSEXPORT extern ostream& operator<<(ostream& target, DOM_Node& toWrite);
00041 /*
00042  * A stream operator for DOM_Strings
00043  */
00044 CLASSEXPORT extern ostream& operator<< (ostream& target, const DOMString& s);
00045 
00063 class CLASSEXPORT skXMLElementObject : public skExecutable {
00064  public:
00068   skXMLElementObject();
00074   skXMLElementObject(const skString& location,DOM_Element elem);
00078   ~skXMLElementObject();
00083   int executableType() const;                   
00087   int intValue() const;
00091   float floatValue() const;
00095   bool boolValue() const;
00099   Char charValue() const;
00103   skString strValue() const;
00111   bool setValue(const skString& name,const skString& attribute,const skRValue& return_value);
00119   bool setValueAt(const skRValue& array_index,const skString& attribute,const skRValue& value); 
00129   bool getValue(const skString& name,const skString& attribute,skRValue& return_value);
00134   bool getValueAt(const skRValue& array_index,const skString& attribute,skRValue& value);
00147   bool method(const skString& name,skRValueArray& args,skRValue& ret,skExecutableContext& ctxt);
00152   void copyItemsInto(DOM_Element other);
00156   virtual void setAddIfNotPresent(bool enable);
00160   virtual bool getAddIfNotPresent();
00165   DOM_Element getElement();
00171   static skString getData(DOM_Element element);
00177   static void setData(DOM_Element element,const skString& data);
00184   static DOM_Element findChild(DOM_Element parent,const skString& tagname);
00191   static DOM_Element findChild(DOM_Element parent,int index);
00200   static DOM_Element findChild(DOM_Element parent,const skString& tagname,const skString& attribute,const skString& value);
00204   void setAttribute(skString name,const skString& value);
00209   skString getAttribute(const skString& name);
00213   static skString toString(DOMString str);
00217   static DOMString fromString(const skString& str);
00221   skString getLocation() const;
00223   static int countChildren(DOM_Element parent);
00228   void save(ostream& out);
00232   virtual skString getSource(const skString& location);
00237   virtual void getInstanceVariables(skRValueTable& table);
00242   virtual void getAttributes(skRValueTable& table);
00243  protected:
00248   virtual void setElement(DOM_Element element);
00254   virtual skXMLElementObject * createXMLElementObject(const skString& location,DOM_Element element);
00258   skString m_ScriptLocation;
00263   skExecutableIterator * createIterator(const skString& qualifier);
00267   skExecutableIterator * createIterator();
00268  private:
00272   DOM_Element m_Element;
00276   skMethodTable * m_MethodCache;
00280   skXMLElementObject(const skXMLElementObject&);
00284   skXMLElementObject& operator=(const skXMLElementObject&);
00286   void save(ostream& target, DOM_Node& toWrite,XMLFormatter& formatter,XMLCh* encoding_name);
00291   bool m_AddIfNotPresent;
00292 
00293 };
00294 
00295 #endif

Generated on Tue Mar 18 19:46:18 2003 for Simkin by doxygen1.3-rc1