peiyongz    2003/10/10 09:23:30

  Modified:    c/src/xercesc/framework Makefile.in XMLAttDef.cpp
                        XMLAttDef.hpp XMLAttDefList.hpp XMLElementDecl.cpp
                        XMLElementDecl.hpp XMLEntityDecl.cpp
                        XMLEntityDecl.hpp XMLNotationDecl.cpp
                        XMLNotationDecl.hpp
  Added:       c/src/xercesc/framework XMLAttDefList.cpp
  Log:
  Implementation of Serialization/Deserialization
  
  Revision  Changes    Path
  1.13      +4 -0      xml-xerces/c/src/xercesc/framework/Makefile.in
  
  Index: Makefile.in
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/Makefile.in,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- Makefile.in       30 Sep 2003 18:14:34 -0000      1.12
  +++ Makefile.in       10 Oct 2003 16:23:29 -0000      1.13
  @@ -55,6 +55,9 @@
   #
   #
   # $Log$
  +# Revision 1.13  2003/10/10 16:23:29  peiyongz
  +# Implementation of Serialization/Deserialization
  +#
   # Revision 1.12  2003/09/30 18:14:34  peiyongz
   # Implementation of Serialization/Deserialization
   #
  @@ -209,6 +212,7 @@
        Wrapper4DOMInputSource.$(TO) \
        Wrapper4InputSource.$(TO) \
        XMLAttDef.$(TO) \
  +     XMLAttDefList.$(TO) \
        XMLAttr.$(TO) \
        XMLBuffer.$(TO) \
        XMLBufferMgr.$(TO) \
  
  
  
  1.7       +43 -1     xml-xerces/c/src/xercesc/framework/XMLAttDef.cpp
  
  Index: XMLAttDef.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/XMLAttDef.cpp,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- XMLAttDef.cpp     1 Oct 2003 16:32:37 -0000       1.6
  +++ XMLAttDef.cpp     10 Oct 2003 16:23:29 -0000      1.7
  @@ -212,5 +212,47 @@
           fMemoryManager->deallocate(fValue);
   }
   
  +/***
  + * Support for Serialization/De-serialization
  + ***/
  +
  +IMPL_XSERIALIZABLE_NOCREATE(XMLAttDef)
  +
  +void XMLAttDef::serialize(XSerializeEngine& serEng)
  +{
  +
  +    if (serEng.isStoring())
  +    {
  +        serEng<<(int)fDefaultType;
  +        serEng<<(int)fType;
  +        serEng<<(int)fCreateReason;
  +        serEng<<fProvided;
  +        serEng<<fExternalAttribute;
  +        serEng<<fId;
  +
  +        serEng.writeString(fValue);
  +        serEng.writeString(fEnumeration);
  +    }
  +    else
  +    {
  +        int i;
  +        serEng>>i;
  +        fDefaultType = (DefAttTypes) i;
  +
  +        serEng>>i;
  +        fType = (AttTypes)i;
  +
  +        serEng>>i;
  +        fCreateReason = (CreateReasons)i;
  +
  +        serEng>>fProvided;
  +        serEng>>fExternalAttribute;
  +        serEng>>fId;
  +
  +        serEng.readString(fValue);
  +        serEng.readString(fEnumeration);
  +    }
  +}
  +
   XERCES_CPP_NAMESPACE_END
   
  
  
  
  1.10      +10 -1     xml-xerces/c/src/xercesc/framework/XMLAttDef.hpp
  
  Index: XMLAttDef.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/XMLAttDef.hpp,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- XMLAttDef.hpp     16 May 2003 21:36:55 -0000      1.9
  +++ XMLAttDef.hpp     10 Oct 2003 16:23:29 -0000      1.10
  @@ -56,6 +56,9 @@
   
   /*
    * $Log$
  + * Revision 1.10  2003/10/10 16:23:29  peiyongz
  + * Implementation of Serialization/Deserialization
  + *
    * Revision 1.9  2003/05/16 21:36:55  knoaman
    * Memory manager implementation: Modify constructors to pass in the memory manager.
    *
  @@ -134,6 +137,7 @@
   #include <xercesc/util/PlatformUtils.hpp>
   #include <xercesc/util/XMLString.hpp>
   #include <xercesc/util/XMemory.hpp>
  +#include <xercesc/internal/XSerializable.hpp>
   
   XERCES_CPP_NAMESPACE_BEGIN
   
  @@ -157,7 +161,7 @@
    *  enumerated or notation type, it will have an 'enumeration value' as well
    *  which is a space separated list of its possible vlaues.
    */
  -class XMLPARSER_EXPORT XMLAttDef : public XMemory
  +class XMLPARSER_EXPORT XMLAttDef : public XSerializable, public XMemory
   {
   public:
       // -----------------------------------------------------------------------
  @@ -507,6 +511,11 @@
       void setExternalAttDeclaration(const bool aValue);
   
       //@}
  +
  +    /***
  +     * Support for Serialization/De-serialization
  +     ***/
  +    DECL_XSERIALIZABLE(XMLAttDef)
   
   protected :
       // -----------------------------------------------------------------------
  
  
  
  1.5       +11 -1     xml-xerces/c/src/xercesc/framework/XMLAttDefList.hpp
  
  Index: XMLAttDefList.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/XMLAttDefList.hpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- XMLAttDefList.hpp 16 May 2003 21:36:55 -0000      1.4
  +++ XMLAttDefList.hpp 10 Oct 2003 16:23:29 -0000      1.5
  @@ -56,6 +56,9 @@
   
   /*
    * $Log$
  + * Revision 1.5  2003/10/10 16:23:29  peiyongz
  + * Implementation of Serialization/Deserialization
  + *
    * Revision 1.4  2003/05/16 21:36:55  knoaman
    * Memory manager implementation: Modify constructors to pass in the memory manager.
    *
  @@ -89,6 +92,8 @@
   #define XMLATTDEFLIST_HPP
   
   #include <xercesc/util/XercesDefs.hpp>
  +#include <xercesc/util/XMemory.hpp>
  +#include <xercesc/internal/XSerializable.hpp>
   
   XERCES_CPP_NAMESPACE_BEGIN
   
  @@ -110,7 +115,8 @@
    *  there are portability issues with deriving from a template class in a
    *  DLL. It does though provide a similar enumerator interface.
    */
  -class XMLPARSER_EXPORT XMLAttDefList : public XMemory
  +
  +class XMLPARSER_EXPORT XMLAttDefList : public XSerializable, public XMemory
   {
   public:
       // -----------------------------------------------------------------------
  @@ -151,6 +157,10 @@
       virtual XMLAttDef& nextElement() = 0;
       virtual void Reset() = 0;
   
  +    /***
  +     * Support for Serialization/De-serialization
  +     ***/
  +    DECL_XSERIALIZABLE(XMLAttDefList)
   
   protected :
       // -----------------------------------------------------------------------
  
  
  
  1.7       +31 -1     xml-xerces/c/src/xercesc/framework/XMLElementDecl.cpp
  
  Index: XMLElementDecl.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/XMLElementDecl.cpp,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- XMLElementDecl.cpp        18 May 2003 14:02:04 -0000      1.6
  +++ XMLElementDecl.cpp        10 Oct 2003 16:23:29 -0000      1.7
  @@ -135,5 +135,35 @@
   {
   }
   
  +/***
  + * Support for Serialization/De-serialization
  + ***/
  +
  +IMPL_XSERIALIZABLE_NOCREATE(XMLElementDecl)
  +
  +void XMLElementDecl::serialize(XSerializeEngine& serEng)
  +{
  +
  +    if (serEng.isStoring())
  +    {
  +        serEng<<fElementName;
  +        serEng<<(int) fCreateReason;
  +        serEng<<fId;
  +        serEng<<fExternalElement;
  +    }
  +    else
  +    {
  +        serEng>>fElementName;
  +
  +        int i;
  +        serEng>>i;
  +        fCreateReason=(CreateReasons)i;
  +
  +        serEng>>fId;
  +        serEng>>fExternalElement;
  +    }
  +
  +}
  +
   XERCES_CPP_NAMESPACE_END
   
  
  
  
  1.8       +9 -1      xml-xerces/c/src/xercesc/framework/XMLElementDecl.hpp
  
  Index: XMLElementDecl.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/XMLElementDecl.hpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- XMLElementDecl.hpp        16 May 2003 21:36:55 -0000      1.7
  +++ XMLElementDecl.hpp        10 Oct 2003 16:23:29 -0000      1.8
  @@ -56,6 +56,9 @@
   
   /*
    * $Log$
  + * Revision 1.8  2003/10/10 16:23:29  peiyongz
  + * Implementation of Serialization/Deserialization
  + *
    * Revision 1.7  2003/05/16 21:36:55  knoaman
    * Memory manager implementation: Modify constructors to pass in the memory manager.
    *
  @@ -146,6 +149,7 @@
   #include <xercesc/framework/XMLAttDefList.hpp>
   #include <xercesc/util/XMLString.hpp>
   #include <xercesc/util/PlatformUtils.hpp>
  +#include <xercesc/internal/XSerializable.hpp>
   
   XERCES_CPP_NAMESPACE_BEGIN
   
  @@ -167,7 +171,7 @@
    *  with invalid or PCDATA element ids without having to know what type of
    *  validator its messing with.)
    */
  -class XMLPARSER_EXPORT XMLElementDecl : public XMemory
  +class XMLPARSER_EXPORT XMLElementDecl : public XSerializable, public XMemory
   {
    public:
       // -----------------------------------------------------------------------
  @@ -587,6 +591,10 @@
   
       //@}
   
  +    /***
  +     * Support for Serialization/De-serialization
  +     ***/
  +    DECL_XSERIALIZABLE(XMLElementDecl)
   
   protected :
       // -----------------------------------------------------------------------
  
  
  
  1.9       +34 -1     xml-xerces/c/src/xercesc/framework/XMLEntityDecl.cpp
  
  Index: XMLEntityDecl.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/XMLEntityDecl.cpp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- XMLEntityDecl.cpp 1 Oct 2003 16:32:37 -0000       1.8
  +++ XMLEntityDecl.cpp 10 Oct 2003 16:23:29 -0000      1.9
  @@ -191,5 +191,38 @@
       fMemoryManager->deallocate(fBaseURI);
   }
   
  +/***
  + * Support for Serialization/De-serialization
  + ***/
  +
  +IMPL_XSERIALIZABLE_NOCREATE(XMLEntityDecl)
  +
  +void XMLEntityDecl::serialize(XSerializeEngine& serEng)
  +{
  +
  +    if (serEng.isStoring())
  +    {
  +        serEng<<fId;
  +        serEng<<fValueLen;
  +        serEng.writeString(fValue);
  +        serEng.writeString(fName);
  +        serEng.writeString(fNotationName);
  +        serEng.writeString(fPublicId);
  +        serEng.writeString(fSystemId);
  +        serEng.writeString(fBaseURI);
  +    }
  +    else
  +    {
  +        serEng>>fId;
  +        serEng>>fValueLen;
  +        serEng.readString(fValue);
  +        serEng.readString(fName);
  +        serEng.readString(fNotationName);
  +        serEng.readString(fPublicId);
  +        serEng.readString(fSystemId);
  +        serEng.readString(fBaseURI);
  +    }
  +}
  +
   XERCES_CPP_NAMESPACE_END
   
  
  
  
  1.8       +9 -1      xml-xerces/c/src/xercesc/framework/XMLEntityDecl.hpp
  
  Index: XMLEntityDecl.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/XMLEntityDecl.hpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- XMLEntityDecl.hpp 16 May 2003 21:36:55 -0000      1.7
  +++ XMLEntityDecl.hpp 10 Oct 2003 16:23:29 -0000      1.8
  @@ -56,6 +56,9 @@
   
   /*
    * $Log$
  + * Revision 1.8  2003/10/10 16:23:29  peiyongz
  + * Implementation of Serialization/Deserialization
  + *
    * Revision 1.7  2003/05/16 21:36:55  knoaman
    * Memory manager implementation: Modify constructors to pass in the memory manager.
    *
  @@ -106,6 +109,7 @@
   #include <xercesc/util/XMemory.hpp>
   #include <xercesc/util/PlatformUtils.hpp>
   #include <xercesc/util/XMLString.hpp>
  +#include <xercesc/internal/XSerializable.hpp>
   
   XERCES_CPP_NAMESPACE_BEGIN
   
  @@ -127,7 +131,7 @@
    *  or whatever, at which time they confirm the correctness of the data before
    *  creating the entity decl object.
    */
  -class XMLPARSER_EXPORT XMLEntityDecl : public XMemory
  +class XMLPARSER_EXPORT XMLEntityDecl : public XSerializable, public XMemory
   {
   public:
       // -----------------------------------------------------------------------
  @@ -392,6 +396,10 @@
   
       //@}
   
  +    /***
  +     * Support for Serialization/De-serialization
  +     ***/
  +    DECL_XSERIALIZABLE(XMLEntityDecl)
   
   private :
       // -----------------------------------------------------------------------
  
  
  
  1.8       +30 -0     xml-xerces/c/src/xercesc/framework/XMLNotationDecl.cpp
  
  Index: XMLNotationDecl.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/XMLNotationDecl.cpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- XMLNotationDecl.cpp       1 Oct 2003 16:32:38 -0000       1.7
  +++ XMLNotationDecl.cpp       10 Oct 2003 16:23:29 -0000      1.8
  @@ -56,6 +56,9 @@
   
   /**
    * $Log$
  + * Revision 1.8  2003/10/10 16:23:29  peiyongz
  + * Implementation of Serialization/Deserialization
  + *
    * Revision 1.7  2003/10/01 16:32:38  neilg
    * improve handling of out of memory conditions, bug #23415.  Thanks to David 
Cargill.
    *
  @@ -170,5 +173,32 @@
       fMemoryManager->deallocate(fSystemId);
       fMemoryManager->deallocate(fBaseURI);
   }
  +
  +/***
  + * Support for Serialization/De-serialization
  + ***/
  +
  +IMPL_XSERIALIZABLE_TOCREATE(XMLNotationDecl)
  +
  +void XMLNotationDecl::serialize(XSerializeEngine& serEng)
  +{
  +    if (serEng.isStoring())
  +    {
  +        serEng<<fId;
  +        serEng.writeString(fName);
  +        serEng.writeString(fPublicId);
  +        serEng.writeString(fSystemId);
  +        serEng.writeString(fBaseURI);
  +    }
  +    else
  +    {
  +        serEng>>fId;
  +        serEng.readString(fName);
  +        serEng.readString(fPublicId);
  +        serEng.readString(fSystemId);
  +        serEng.readString(fBaseURI);
  +    }
  +}
  +
   
   XERCES_CPP_NAMESPACE_END
  
  
  
  1.9       +9 -1      xml-xerces/c/src/xercesc/framework/XMLNotationDecl.hpp
  
  Index: XMLNotationDecl.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/XMLNotationDecl.hpp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- XMLNotationDecl.hpp       22 May 2003 02:10:51 -0000      1.8
  +++ XMLNotationDecl.hpp       10 Oct 2003 16:23:29 -0000      1.9
  @@ -56,6 +56,9 @@
   
   /*
    * $Log$
  + * Revision 1.9  2003/10/10 16:23:29  peiyongz
  + * Implementation of Serialization/Deserialization
  + *
    * Revision 1.8  2003/05/22 02:10:51  knoaman
    * Default the memory manager.
    *
  @@ -108,6 +111,7 @@
   #include <xercesc/util/XMemory.hpp>
   #include <xercesc/util/PlatformUtils.hpp>
   #include <xercesc/util/XMLString.hpp>
  +#include <xercesc/internal/XSerializable.hpp>
   
   XERCES_CPP_NAMESPACE_BEGIN
   
  @@ -120,7 +124,7 @@
    *  At this common level, the information supported is the notation name
    *  and the public and sysetm ids indicated in the notation declaration.
    */
  -class XMLPARSER_EXPORT XMLNotationDecl : public XMemory
  +class XMLPARSER_EXPORT XMLNotationDecl : public XSerializable, public XMemory
   {
   public:
       // -----------------------------------------------------------------------
  @@ -175,6 +179,10 @@
       // -----------------------------------------------------------------------
       const XMLCh* getKey() const;
   
  +    /***
  +     * Support for Serialization/De-serialization
  +     ***/
  +    DECL_XSERIALIZABLE(XMLNotationDecl)
   
   private :
       // -----------------------------------------------------------------------
  
  
  
  1.1                  xml-xerces/c/src/xercesc/framework/XMLAttDefList.cpp
  
  Index: XMLAttDefList.cpp
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999-2003 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Xerces" and "Apache Software Foundation" must
   *    not be used to endorse or promote products derived from this
   *    software without prior written permission. For written
   *    permission, please contact [EMAIL PROTECTED]
   *
   * 5. Products derived from this software may not be called "Apache",
   *    nor may "Apache" appear in their name, without prior written
   *    permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation, and was
   * originally based on software copyright (c) 1999, International
   * Business Machines, Inc., http://www.ibm.com .  For more information
   * on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  
  /**
   * $Id: XMLAttDefList.cpp,v 1.1 2003/10/10 16:23:29 peiyongz Exp $
   * $Log: XMLAttDefList.cpp,v $
   * Revision 1.1  2003/10/10 16:23:29  peiyongz
   * Implementation of Serialization/Deserialization
   *
   */
  
  
  // ---------------------------------------------------------------------------
  //  Includes
  // ---------------------------------------------------------------------------
  #include <xercesc/framework/XMLAttDefList.hpp>
  
  XERCES_CPP_NAMESPACE_BEGIN
  
  /***
   * Support for Serialization/De-serialization
   ***/
  
  IMPL_XSERIALIZABLE_NOCREATE(XMLAttDefList)
  
  void XMLAttDefList::serialize(XSerializeEngine& serEng)
  {
      //no data
  }
  
  XERCES_CPP_NAMESPACE_END
  
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to