dbertoni    00/04/20 09:42:31

  Modified:    c/src/PlatformSupport DirectoryEnumerator.hpp
                        DOMStringHelper.cpp DOMStringHelper.hpp
                        DoubleSupport.cpp
  Log:
  Fixed namespace problems, and made some string helpers work like Java.
  
  Revision  Changes    Path
  1.7       +5 -1      xml-xalan/c/src/PlatformSupport/DirectoryEnumerator.hpp
  
  Index: DirectoryEnumerator.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/DirectoryEnumerator.hpp,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DirectoryEnumerator.hpp   2000/04/11 14:35:30     1.6
  +++ DirectoryEnumerator.hpp   2000/04/20 16:42:28     1.7
  @@ -273,8 +273,12 @@
        operator()(const argument_type&         theDirectory,
                           CollectionType&                      theCollection) 
const
        {
  +#if !defined(XALAN_NO_NAMESPACES)
  +             using std::back_inserter;
  +#endif
  +
                EnumerateDirectory(theDirectory,
  -                                                
std::back_inserter(theCollection),
  +                                                back_inserter(theCollection),
                                                   m_filterPredicate,
                                                   m_conversionFunction);
        }
  
  
  
  1.16      +12 -8     xml-xalan/c/src/PlatformSupport/DOMStringHelper.cpp
  
  Index: DOMStringHelper.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/DOMStringHelper.cpp,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- DOMStringHelper.cpp       2000/04/11 20:04:24     1.15
  +++ DOMStringHelper.cpp       2000/04/20 16:42:28     1.16
  @@ -299,18 +299,21 @@
        const unsigned int      theStringLength = length(theString);
        assert(theStringLength >= 0);
   
  -     const unsigned int      theSubStringLength = length(theSubstring);
  -     assert(theSubStringLength >= 0);
  +     const unsigned int      theSubstringLength = length(theSubstring);
  +     assert(theSubstringLength >= 0);
   
  -     // If either string is of length 0, or if the substring
  -     // is longer, there's no point in continuing.
  -     if (theStringLength >= theSubStringLength)
  +     if (theSubstringLength == 0)
        {
  +             // Make this work like Java...
  +             return true;
  +     }
  +     else if (theStringLength >= theSubstringLength)
  +     {
                unsigned int    i = 0;
   
                // Compare each character...
                for (;
  -                             i < theSubStringLength &&
  +                             i < theSubstringLength &&
                                                theString[i] == theSubstring[i];
                                        i++)
                {
  @@ -319,7 +322,7 @@
   
                // If we've gotten to the end of the substring, then
                // return true.
  -             if (i == theSubStringLength)
  +             if (i == theSubstringLength)
                {
                        fResult = true;
                }
  @@ -353,7 +356,8 @@
        }
        else if (isEmpty(theSubstring) == true)
        {
  -             return false;
  +             // Apparently, Java believes this to be true;
  +             return true;
        }
        else
        {
  
  
  
  1.13      +4 -2      xml-xalan/c/src/PlatformSupport/DOMStringHelper.hpp
  
  Index: DOMStringHelper.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/DOMStringHelper.hpp,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- DOMStringHelper.hpp       2000/04/11 14:35:29     1.12
  +++ DOMStringHelper.hpp       2000/04/20 16:42:29     1.13
  @@ -638,11 +638,13 @@
    */
   #if defined(XALAN_NO_NAMESPACES)
   inline ostream&
  +operator<<(
  +                     ostream&                                theStream,
   #else
   inline std::ostream&
  -#endif
   operator<<(
                        std::ostream&                   theStream,
  +#endif
                        const XalanDOMString&   theString)
   {
        OutputString(theStream,
  @@ -1246,7 +1248,7 @@
   #else
   XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(std::string)
   #endif
  -DOMStringToStdString(const XalanDOMString& domString);
  +DOMStringToStdString(const XalanDOMString&   domString);
   
   
   
  
  
  
  1.5       +11 -3     xml-xalan/c/src/PlatformSupport/DoubleSupport.cpp
  
  Index: DoubleSupport.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/DoubleSupport.cpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DoubleSupport.cpp 2000/02/22 17:33:31     1.4
  +++ DoubleSupport.cpp 2000/04/20 16:42:29     1.5
  @@ -80,9 +80,17 @@
   #error Unsupported platform!!!
   #endif
   #else
  -const double DoubleSupport::s_NaN = std::numeric_limits<double>::quiet_NaN();
  -const double DoubleSupport::s_positiveInfinity = 
std::numeric_limits<double>::infinity();
  -const double DoubleSupport::s_negativeInfinity = 
std::numeric_limits<double>::signaling_NaN();
  +
  +#if defined(XALAN_NO_NAMESPACES)
  +typedef numeric_limits<double>                       NumericLimitsType;
  +#else
  +typedef std::numeric_limits<double>          NumericLimitsType;
  +#endif
  +
  +const double DoubleSupport::s_NaN = NumericLimitsType::quiet_NaN();
  +const double DoubleSupport::s_positiveInfinity = 
NumericLimitsType::infinity();
  +const double DoubleSupport::s_negativeInfinity = 
NumericLimitsType::signaling_NaN();
  +
   #endif
   
   
  
  
  

Reply via email to