HydraExpress™ C++ API Reference Guide

 
Loading...
Searching...
No Matches
rwsf::XmlParseLineColException Class Reference

Defines a parse exception including line and column meta information. More...

#include <rwsf/core/XmlParseLineColException.h>

Inheritance diagram for rwsf::XmlParseLineColException:
rwsf::XmlParseException rwsf::XmlException rwsf::Exception

Public Member Functions

virtual ~XmlParseLineColException () noexcept
size_t getColumnNumber (void) const
size_t getLineNumber (void) const
Public Member Functions inherited from rwsf::XmlParseException
 XmlParseException (const char *msg)
 XmlParseException (const rwsf::ExceptionInfo &eInfo)
 XmlParseException (const rwsf::ExceptionInfo &eInfo, const rwsf::LocalizedMessage &msg)
 XmlParseException (const std::string &msg)
virtual ~XmlParseException () noexcept
Public Member Functions inherited from rwsf::XmlException
 XmlException (const rwsf::ExceptionInfo &eInfo)
 XmlException (const rwsf::ExceptionInfo &eInfo, const rwsf::LocalizedMessage &msg)
virtual ~XmlException () noexcept
Public Member Functions inherited from rwsf::Exception
 Exception (const char *msg)
 Exception (const Exception &)
 Exception (const ExceptionInfo &eInfo)
 Exception (const rwsf::ExceptionInfo &eInfo, const LocalizedMessage &msg)
 Exception (const std::string &msg)
virtual ~Exception () noexcept
const char * getFileName () const
const char * getFunctionName () const
unsigned long getLineNumber () const
virtual bool operator!= (const Exception exc2)
Exceptionoperator= (const Exception &m)
virtual bool operator== (const Exception exc2)
virtual const char * what () const noexcept

Private Member Functions

virtual Exceptionclone (void) const
virtual void raise (void) const

Additional Inherited Members

Detailed Description

XmlParseLineColException defines an exception type that captures line and column information for where the parse failure occurs.

The code sample below shows a try-catch block that contains a call to unmarshal(). The XML parsing error exception contains a descriptive message and the line number and column number at which the method detected the error.

try {
aComplexType.unmarshal(xmlContents);
} catch (const rwsf::XmlParseLineColException &e) {
std::cerr << "Parse error when unmarshaling : "
<< e.what() << std::endl;
std::cerr << "Line number: " << e.getLineNumber()
<< std::endl;
std::cerr << "Column number: " << e.getColumnNumber()
<< std::endl;
return 1;
} catch (const rwsf::Exception &e) {
std::cerr << "Error : " << e.what() << std::endl;
return 1;
} catch (const RWxmsg &e) {
std::cerr << "Error : " << e.what() << std::endl;
return 1;
}catch (const std::exception &e) {
std:: cerr << "Error : " << e.what() << std::endl;
return 1;
}
The base class for all exceptions in the rwsf namespace.
Definition Exception.h:102
virtual const char * what() const noexcept
Defines a parse exception including line and column meta information.
Definition XmlParseLineColException.h:55
size_t getLineNumber(void) const
size_t getColumnNumber(void) const

Constructor & Destructor Documentation

◆ ~XmlParseLineColException()

virtual rwsf::XmlParseLineColException::~XmlParseLineColException ( )
virtualnoexcept

Destructor.

Member Function Documentation

◆ clone()

virtual Exception * rwsf::XmlParseLineColException::clone ( void ) const
privatevirtual

Creates a new copy of self on the heap. Overridden in derived classes to construct an instance of the correct derived type. It is up to the user to ensure that the returned Exception object is deleted.

Reimplemented from rwsf::XmlParseException.

◆ getColumnNumber()

size_t rwsf::XmlParseLineColException::getColumnNumber ( void ) const

Returns the column number in the XML document where the parse error occurred.

◆ getLineNumber()

size_t rwsf::XmlParseLineColException::getLineNumber ( void ) const

Returns the line number in the XML document where the parse error occurred.

◆ raise()

virtual void rwsf::XmlParseLineColException::raise ( void ) const
privatevirtual

Methods defined by macro in Exception.h. raise (throw) clone (copy)

Reimplemented from rwsf::XmlParseException.

Copyright © 2026 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.