dbertoni    01/03/29 14:10:05

  Modified:    c/src/PlatformSupport AttributeListImpl.cpp
                        AttributeListImpl.hpp
  Log:
  Moved AttributeVectorEntry out.
  
  Revision  Changes    Path
  1.18      +10 -24    xml-xalan/c/src/PlatformSupport/AttributeListImpl.cpp
  
  Index: AttributeListImpl.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/AttributeListImpl.cpp,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- AttributeListImpl.cpp     2001/03/04 19:41:15     1.17
  +++ AttributeListImpl.cpp     2001/03/29 22:10:04     1.18
  @@ -68,6 +68,7 @@
   
   
   
  +#include "AttributeVectorEntry.hpp"
   #include "STLHelper.hpp"
   
   
  @@ -269,7 +270,7 @@
        }
   
        bool
  -     operator()(const AttributeListImpl::AttributeVectorEntry*       
theEntry) const
  +     operator()(const AttributeVectorEntry*  theEntry) const
        {
                return equals(&*theEntry->m_Name.begin(), m_name);
        }
  @@ -356,23 +357,6 @@
   
   
   
  -// A convenience function to find the length of a null-terminated
  -// array of XMLChs
  -inline const XMLCh*
  -endArray(const XMLCh*        data)
  -{
  -     assert(data != 0);
  -
  -     while(*data)
  -     {
  -             ++data;
  -     }
  -
  -     return data;
  -}
  -
  -
  -
   bool
   AttributeListImpl::addAttribute(
                        const XMLCh*    name,
  @@ -390,6 +374,8 @@
        using std::copy;
   #endif
   
  +     typedef AttributeVectorEntry::XMLChVectorType   XMLChVectorType;
  +
        // Update the attribute, if it's already there...
        const AttributeVectorType::const_iterator       i =
                find_if(
  @@ -404,7 +390,7 @@
                {
                        // If necessary, create the a new vector and swap them. 
 Otherwise,
                        // just copy the new data in.
  -                     const XMLCh* const      theNewTypeEnd = endArray(type) 
+ 1;
  +                     const XMLCh* const      theNewTypeEnd = 
AttributeVectorEntry::endArray(type) + 1;
   
                        if ((*i)->m_Type.capacity() < 
XMLChVectorType::size_type(theNewTypeEnd - type))
                        {
  @@ -418,7 +404,7 @@
                        }
                }
   
  -             const XMLCh* const      theNewValueEnd = endArray(value) + 1;
  +             const XMLCh* const      theNewValueEnd = 
AttributeVectorEntry::endArray(value) + 1;
   
                // If necessary, create the a new vector and swap them.  
Otherwise,
                // just copy the new data in.
  @@ -457,7 +443,7 @@
   
   
   
  -AttributeListImpl::AttributeVectorEntry*
  +AttributeVectorEntry*
   AttributeListImpl::getNewEntry(
                        const XMLCh*    name,
                        const XMLCh*    type,
  @@ -476,9 +462,9 @@
   
                assert(theEntry->m_Name.size() == 0 && theEntry->m_Value.size() 
== 0 && theEntry->m_Type.size() == 0);
   
  -             theEntry->m_Name.insert(theEntry->m_Name.begin(), name, 
endArray(name) + 1);
  -             theEntry->m_Value.insert(theEntry->m_Value.begin(), value, 
endArray(value) + 1);
  -             theEntry->m_Type.insert(theEntry->m_Type.begin(), type, 
endArray(type) + 1);
  +             theEntry->m_Name.insert(theEntry->m_Name.begin(), name, 
AttributeVectorEntry::endArray(name) + 1);
  +             theEntry->m_Value.insert(theEntry->m_Value.begin(), value, 
AttributeVectorEntry::endArray(value) + 1);
  +             theEntry->m_Type.insert(theEntry->m_Type.begin(), type, 
AttributeVectorEntry::endArray(type) + 1);
   
                m_cacheVector.pop_back();
   
  
  
  
  1.14      +1 -43     xml-xalan/c/src/PlatformSupport/AttributeListImpl.hpp
  
  Index: AttributeListImpl.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/AttributeListImpl.hpp,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- AttributeListImpl.hpp     2000/11/20 20:04:25     1.13
  +++ AttributeListImpl.hpp     2001/03/29 22:10:04     1.14
  @@ -72,7 +72,7 @@
   
   
   
  -#include <PlatformSupport/DOMStringHelper.hpp>
  +class AttributeVectorEntry;
   
   
   
  @@ -170,48 +170,6 @@
        {
                m_AttributeVector.reserve(theCount);
        }
  -
  -     // A struct to hold information about each attribute.
  -     struct AttributeVectorEntry
  -     {
  -#if defined(XALAN_NO_NAMESPACES)
  -             typedef vector<XMLCh>           XMLChVectorType;
  -#else
  -             typedef std::vector<XMLCh>      XMLChVectorType;
  -#endif
  -
  -             AttributeVectorEntry(const XMLChVectorType&     theName = 
XMLChVectorType(),
  -                                                      const XMLChVectorType& 
theValue = XMLChVectorType(),
  -                                                      const XMLChVectorType& 
theType = XMLChVectorType()) :
  -                     m_Name(theName),
  -                     m_Value(theValue),
  -                     m_Type(theType)
  -             {
  -             }
  -
  -             AttributeVectorEntry(const XMLCh*       theName,
  -                                                      const XMLCh*   
theValue,
  -                                                      const XMLCh*   
theType) :
  -                     m_Name(theName, theName + length(theName) + 1),
  -                     m_Value(theValue, theValue + length(theValue) + 1),
  -                     m_Type(theType, theType + length(theType) + 1)
  -             {
  -             }
  -
  -             void
  -             clear()
  -             {
  -                     m_Name.clear();
  -                     m_Value.clear();
  -                     m_Type.clear();
  -             }
  -
  -             XMLChVectorType         m_Name;
  -             XMLChVectorType         m_Value;
  -             XMLChVectorType         m_Type;
  -     };
  -
  -     typedef AttributeVectorEntry::XMLChVectorType   XMLChVectorType;
   
   #if defined(XALAN_NO_NAMESPACES)
        // This vector will hold the entries.
  
  
  

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

Reply via email to