#include <uriFormatException.h> classCURIFormatException
{CURIFormatException(std::string uri, const char* file, int line);
CURIFormatException(std::string uri, std::string port, const char* file, int line);
CURIFormatException(std::string uri, const char* host, const char* file, int line);
CURIFormatException(const CURIFormatException& rhs);
virtual ~CURIFormatException();
CURIFormatException& operator=(const CURIFormatException& rhs);
const int operator==(const CURIFormatException& rhs);
const int operator!=(const CURIFormatException& rhs);
virtual const const char* ReasonText();
virtual const Int_t ReasonCode();
};
This exception is a subclass of
CException
.
It is specialized to report exceptions encountered parsing Uniform
Resource Identifiers (uris).
The reason text is human readable, but the reason code is always
-1.
Typcially the exception is used to either present an error message to the user. Once the exception is caught, tyipical program action is to either prompt the user to correct the faulty uri or to exit, depending on the level of interactivity assumed by the application.
Constructors.
A rich set of constructors is provided to build the exception
according to the actual error. In all the constructors above, the
current action is constructed from the
file
and line
parameters
which are the names of the constructing file and line number
at which the construction occured. You should use the
preprocessor __FILE__ and __LINE__
macros for the file
and line
parameters unless you have some special needs.
CURIFormatException(std::string uri, const char* file, int line);
Constructs the exception when the URI uri
just can't be parsed.
CURIFormatException(std::string uri, std::string port, const char* file, int line);
Constructs the exception when the URI uri
has a string port
which should be a port
number but can't be properly processed as a port.
CURIFormatException(std::string uri, const char* host, const char* file, int line);
This constructor creates the exception objects for the URI
uri
when the
host
should be a host name but cannot
be resolved to an IP address. The assumption is that the
URI being constructed will actually be used.
CURIFormatException(const CURIFormatException& rhs);
Copy Construction
Canonical operations.
The CURIFormatException
class
supports assignment and comparisons for equality and
inequality such that two equal exceptions where created in
the same place for the same reason.
CException
interface.
virtual const const char* ReasonText();
Returns a human readable exception string.
virtual const Int_t ReasonCode();
Returns -1.