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.1 2003/04/14 15:53:26 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;
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);
00149   bool method(const skString& name,skRValueArray& args,skRValue& ret,skExecutableContext& ctxt);
00154   void copyItemsInto(DOM_Element other);
00158   virtual void setAddIfNotPresent(bool enable);
00162   virtual bool getAddIfNotPresent();
00167   DOM_Element getElement();
00173   static skString getData(DOM_Element element);
00179   static void setData(DOM_Element element,const skString& data);
00186   static DOM_Element findChild(DOM_Element parent,const skString& tagname);
00193   static DOM_Element findChild(DOM_Element parent,int index);
00202   static DOM_Element findChild(DOM_Element parent,const skString& tagname,const skString& attribute,const skString& value);
00206   void setAttribute(skString name,const skString& value);
00211   skString getAttribute(const skString& name);
00215   static skString toString(DOMString str);
00219   static DOMString fromString(const skString& str);
00223   skString getLocation() const;
00225   static int countChildren(DOM_Element parent);
00230   void save(ostream& out);
00234   virtual skString getSource(const skString& location);
00239   virtual void getInstanceVariables(skRValueTable& table);
00244   virtual void getAttributes(skRValueTable& table);
00245  protected:
00250   virtual void setElement(DOM_Element element);
00256   virtual skXMLElementObject * createXMLElementObject(const skString& location,DOM_Element element);
00260   skString m_ScriptLocation;
00265   skExecutableIterator * createIterator(const skString& qualifier);
00269   skExecutableIterator * createIterator();
00270  private:
00274   DOM_Element m_Element;
00278   skMethodTable * m_MethodCache;
00282   skXMLElementObject(const skXMLElementObject&);
00286   skXMLElementObject& operator=(const skXMLElementObject&);
00288   void save(ostream& target, DOM_Node& toWrite,XMLFormatter& formatter,XMLCh* encoding_name);
00293   bool m_AddIfNotPresent;
00294 
00295 };
00296 
00297 #endif

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