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_8h-source.html,v 1.17 2004/12/17 21:31:14 sdw 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;
00088 #ifdef USE_FLOATING_POINT
00089 
00092   float floatValue() const;
00093 #endif
00094 
00097   bool boolValue() const;
00101   Char charValue() const;
00105   skString strValue() const;
00113   bool setValue(const skString& name,const skString& attribute,const skRValue& return_value);
00121   bool setValueAt(const skRValue& array_index,const skString& attribute,const skRValue& value); 
00131   bool getValue(const skString& name,const skString& attribute,skRValue& return_value);
00136   bool getValueAt(const skRValue& array_index,const skString& attribute,skRValue& value);
00151   bool method(const skString& name,skRValueArray& args,skRValue& ret,skExecutableContext& ctxt);
00156   void copyItemsInto(DOM_Element other);
00160   virtual void setAddIfNotPresent(bool enable);
00164   virtual bool getAddIfNotPresent();
00169   DOM_Element getElement();
00175   static skString getData(DOM_Element element);
00181   static void setData(DOM_Element element,const skString& data);
00188   static DOM_Element findChild(DOM_Element parent,const skString& tagname);
00195   static DOM_Element findChild(DOM_Element parent,int index);
00204   static DOM_Element findChild(DOM_Element parent,const skString& tagname,const skString& attribute,const skString& value);
00208   void setAttribute(skString name,const skString& value);
00213   skString getAttribute(const skString& name);
00217   static skString toString(DOMString str);
00221   static DOMString fromString(const skString& str);
00225   skString getLocation() const;
00227   static int countChildren(DOM_Element parent);
00232   void save(ostream& out);
00236   virtual skString getSource(const skString& location);
00241   virtual void getInstanceVariables(skRValueTable& table);
00246   virtual void getAttributes(skRValueTable& table);
00247  protected:
00252   virtual void setElement(DOM_Element element);
00258   virtual skXMLElementObject * createXMLElementObject(const skString& location,DOM_Element element);
00262   skString m_ScriptLocation;
00267   skExecutableIterator * createIterator(const skString& qualifier);
00271   skExecutableIterator * createIterator();
00272  private:
00276   DOM_Element m_Element;
00280   skMethodTable * m_MethodCache;
00284   skXMLElementObject(const skXMLElementObject&);
00288   skXMLElementObject& operator=(const skXMLElementObject&);
00290   void save(ostream& target, DOM_Node& toWrite,XMLFormatter& formatter,XMLCh* encoding_name);
00295   bool m_AddIfNotPresent;
00296 
00297 };
00298 
00299 #endif

Generated on Fri Dec 17 20:27:34 2004 for Simkin by doxygen1.3