version 1.35.2.1, 2006/02/10 16:09:39
|
version 1.42, 2007/07/30 06:50:57
|
|
|
// | // |
//============================================================================== | //============================================================================== |
// | // |
// Author: Mike Brasher (mbrasher@bmc.com) |
|
// |
|
// Modified By: David Dillard, VERITAS Software Corp. |
|
// (david.dillard@veritas.com) |
|
// |
|
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
//////////////////////////////////////////////////////////////////////////////// | //////////////////////////////////////////////////////////////////////////////// |
|
|
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
#define PEGASUS_ARRAY_T XmlEntry |
|
# include "ArrayImpl.h" |
|
#undef PEGASUS_ARRAY_T |
|
|
|
//////////////////////////////////////////////////////////////////////////////// | //////////////////////////////////////////////////////////////////////////////// |
// | // |
// Static helper functions | // Static helper functions |
|
|
} | } |
*/ | */ |
| |
static MessageLoaderParms _formMessage(Uint32 code, Uint32 line, const String& message) |
static MessageLoaderParms _formMessage( |
|
Uint32 code, |
|
Uint32 line, |
|
const String& message) |
{ | { |
String dftMsg = _xmlMessages[Uint32(code) - 1]; | String dftMsg = _xmlMessages[Uint32(code) - 1]; |
String key = _xmlKeys[Uint32(code) - 1]; | String key = _xmlKeys[Uint32(code) - 1]; |
|
|
const String& message) | const String& message) |
: XmlException(XmlException::VALIDATION_ERROR, lineNumber, message) | : XmlException(XmlException::VALIDATION_ERROR, lineNumber, message) |
{ | { |
|
|
} | } |
| |
| |
|
|
MessageLoaderParms& msgParms) | MessageLoaderParms& msgParms) |
: XmlException(XmlException::VALIDATION_ERROR, lineNumber, msgParms) | : XmlException(XmlException::VALIDATION_ERROR, lineNumber, msgParms) |
{ | { |
|
|
} | } |
| |
| |
|
|
const String& message) | const String& message) |
: XmlException(XmlException::SEMANTIC_ERROR, lineNumber, message) | : XmlException(XmlException::SEMANTIC_ERROR, lineNumber, message) |
{ | { |
|
|
} | } |
| |
| |
|
|
MessageLoaderParms& msgParms) | MessageLoaderParms& msgParms) |
: XmlException(XmlException::SEMANTIC_ERROR, lineNumber, msgParms) | : XmlException(XmlException::SEMANTIC_ERROR, lineNumber, msgParms) |
{ | { |
|
|
} | } |
| |
| |
|
|
// | // |
//////////////////////////////////////////////////////////////////////////////// | //////////////////////////////////////////////////////////////////////////////// |
| |
XmlParser::XmlParser(char* text) : _line(1), _text(text), _current(text), |
XmlParser::XmlParser(char* text) |
_restoreChar('\0'), _foundRoot(false) |
: _line(1), |
|
_current(text), |
|
_restoreChar('\0'), |
|
_foundRoot(false) |
{ | { |
|
|
} | } |
| |
inline void _skipWhitespace(Uint32& line, char*& p) | inline void _skipWhitespace(Uint32& line, char*& p) |
|
|
} | } |
} | } |
| |
Boolean XmlParser::next(XmlEntry& entry) |
Boolean XmlParser::next(XmlEntry& entry, Boolean includeComment) |
{ | { |
if (!_putBackStack.isEmpty()) | if (!_putBackStack.isEmpty()) |
{ | { |
|
|
_restoreChar = '\0'; | _restoreChar = '\0'; |
} | } |
| |
|
// Loop until we are done with comments if includeComment is false. |
|
do |
|
{ |
// Skip over any whitespace: | // Skip over any whitespace: |
|
|
_skipWhitespace(_line, _current); | _skipWhitespace(_line, _current); |
| |
if (!*_current) | if (!*_current) |
|
|
| |
_stack.pop(); | _stack.pop(); |
} | } |
|
|
return true; |
|
} | } |
else | else |
{ | { |
|
|
| |
if (nullTerminator) | if (nullTerminator) |
*nullTerminator = '\0'; | *nullTerminator = '\0'; |
|
} |
|
}while (!includeComment && entry.type == XmlEntry::COMMENT); |
| |
return true; | return true; |
} | } |
} |
|
| |
void XmlParser::putBack(XmlEntry& entry) | void XmlParser::putBack(XmlEntry& entry) |
{ | { |