(file) Return to XmlParser.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

Diff for /pegasus/src/Pegasus/Common/XmlParser.cpp between version 1.33 and 1.34

version 1.33, 2005/10/31 17:39:12 version 1.34, 2005/11/03 00:35:04
Line 100 
Line 100 
 #include "XmlParser.h" #include "XmlParser.h"
 #include "Logger.h" #include "Logger.h"
 #include "ExceptionRep.h" #include "ExceptionRep.h"
   #include "CharSet.h"
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
Line 155 
Line 156 
 // Section 2.3 of XML 1.0 Standard (http://www.w3.org/TR/REC-xml) // Section 2.3 of XML 1.0 Standard (http://www.w3.org/TR/REC-xml)
 // defines white space as: // defines white space as:
 // S    ::=    (#x20 | #x9 | #xD | #xA)+ // S    ::=    (#x20 | #x9 | #xD | #xA)+
 static int _isspace(char c)  static inline int _isspace(char c)
 { {
         if (c == ' ' || c == '\r' || c == '\t' || c == '\n')      return CharSet::isSpace((Uint8)c);
                 return 1;  
         return 0;  
 } }
  
   
 static Uint32 _REFERENCES_SIZE = (sizeof(_references) / sizeof(_references[0])); static Uint32 _REFERENCES_SIZE = (sizeof(_references) / sizeof(_references[0]));
  
 // Remove all redundant spaces from the given string: // Remove all redundant spaces from the given string:
Line 402 
Line 400 
  
 } }
  
   inline void _skipWhitespace(Uint32& line, char*& p)
   {
       while (*p && _isspace(*p))
       {
           if (*p == '\n')
               line++;
   
           p++;
       }
   }
   
 Boolean XmlParser::next(XmlEntry& entry) Boolean XmlParser::next(XmlEntry& entry)
 { {
     if (!_putBackStack.isEmpty())     if (!_putBackStack.isEmpty())
Line 426 
Line 435 
  
     // Skip over any whitespace:     // Skip over any whitespace:
  
     _skipWhitespace(_current);      _skipWhitespace(_line, _current);
  
     if (!*_current)     if (!*_current)
     {     {
Line 498 
Line 507 
     // Nothing to do!     // Nothing to do!
 } }
  
 void XmlParser::_skipWhitespace(char*& p)  
 {  
     while (*p && _isspace(*p))  
     {  
         if (*p == '\n')  
             _line++;  
   
         p++;  
     }  
 }  
   
 Boolean XmlParser::_getElementName(char*& p) Boolean XmlParser::_getElementName(char*& p)
 { {
     if (!(((*p >= 'A') && (*p <= 'Z')) ||     if (!(((*p >= 'A') && (*p <= 'Z')) ||
Line 529 
Line 527 
     if (_isspace(*p))     if (_isspace(*p))
     {     {
         *p++ = '\0';         *p++ = '\0';
         _skipWhitespace(p);          _skipWhitespace(_line, p);
     }     }
  
     if (*p == '>')     if (*p == '>')
Line 563 
Line 561 
     if (_isspace(*p))     if (_isspace(*p))
     {     {
         *p++ = '\0';         *p++ = '\0';
         _skipWhitespace(p);          _skipWhitespace(_line, p);
     }     }
  
     if (*p == '>')     if (*p == '>')
Line 600 
Line 598 
  
     char* term = p;     char* term = p;
  
     _skipWhitespace(p);      _skipWhitespace(_line, p);
  
     if (*p != '=')     if (*p != '=')
         throw XmlException(XmlException::BAD_ATTRIBUTE_NAME, _line);         throw XmlException(XmlException::BAD_ATTRIBUTE_NAME, _line);
  
     p++;     p++;
  
     _skipWhitespace(p);      _skipWhitespace(_line, p);
  
     *term = '\0';     *term = '\0';
 } }
Line 983 
Line 981 
             throw XmlException(XmlException::BAD_ATTRIBUTE_VALUE, _line);             throw XmlException(XmlException::BAD_ATTRIBUTE_VALUE, _line);
         }         }
  
         _skipWhitespace(p);          _skipWhitespace(_line, p);
  
         if (entry.attributeCount == XmlEntry::MAX_ATTRIBUTES)         if (entry.attributeCount == XmlEntry::MAX_ATTRIBUTES)
             throw XmlException(XmlException::TOO_MANY_ATTRIBUTES, _line);             throw XmlException(XmlException::TOO_MANY_ATTRIBUTES, _line);


Legend:
Removed from v.1.33  
changed lines
  Added in v.1.34

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2