Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Functions | Variables
nsDOMException.cpp File Reference
#include "nsCOMPtr.h"
#include "nsCRT.h"
#include "nsDOMClassInfo.h"
#include "nsDOMError.h"
#include "nsDOMException.h"
#include "nsIDOMDOMException.h"
#include "nsIDOMRangeException.h"
#include "nsString.h"
#include "prprf.h"
#include "domerr.msg"

Go to the source code of this file.

Classes

struct  ResultStruct

Defines

#define DOM_MSG_DEF(val, message)   {(val), #val, message},
#define IMPL_INTERNAL_DOM_EXCEPTION_HEAD(classname, ifname)
#define IMPL_INTERNAL_DOM_EXCEPTION_TAIL(classname, ifname, domname, module, mapping_function)

Functions

static void NSResultToNameAndMessage (nsresult aNSResult, const char **aName, const char **aMessage)
NS_DECL_NSIDOMDOMEXCEPTION IMPL_INTERNAL_DOM_EXCEPTION_TAIL (nsDOMException, nsIDOMDOMException, DOMException, NS_ERROR_MODULE_DOM, NSResultToNameAndMessage) NS_IMETHODIMP nsDOMException
NS_DECL_NSIDOMRANGEEXCEPTION IMPL_INTERNAL_DOM_EXCEPTION_TAIL (nsRangeException, nsIDOMRangeException, RangeException, NS_ERROR_MODULE_DOM_RANGE, NSResultToNameAndMessage) NS_IMETHODIMP nsRangeException

Variables

static struct ResultStruct gDOMErrorMsgMap []

Class Documentation

struct ResultStruct

Definition at line 101 of file nsDOMException.cpp.

Class Members
const char * mMessage
const char * mName
nsresult mNSResult

Define Documentation

#define DOM_MSG_DEF (   val,
  message 
)    {(val), #val, message},

Definition at line 52 of file nsDOMException.cpp.

#define IMPL_INTERNAL_DOM_EXCEPTION_HEAD (   classname,
  ifname 
)
Value:
class classname : public nsBaseDOMException,                                 \
                  public ifname                                              \
{                                                                            \
public:                                                                      \
  classname();                                                               \
  virtual ~classname();                                                      \
                                                                             \
  NS_DECL_ISUPPORTS_INHERITED

Definition at line 54 of file nsDOMException.cpp.

#define IMPL_INTERNAL_DOM_EXCEPTION_TAIL (   classname,
  ifname,
  domname,
  module,
  mapping_function 
)

Definition at line 64 of file nsDOMException.cpp.


Function Documentation

NS_DECL_NSIDOMDOMEXCEPTION IMPL_INTERNAL_DOM_EXCEPTION_TAIL ( nsDOMException  ,
nsIDOMDOMException  ,
DOMException  ,
NS_ERROR_MODULE_DOM  ,
NSResultToNameAndMessage   
)

Definition at line 137 of file nsDOMException.cpp.

{
  NS_ENSURE_ARG_POINTER(aCode);
  nsresult result;
  GetResult(&result);
  *aCode = NS_ERROR_GET_CODE(result);

  return NS_OK;
}
NS_DECL_NSIDOMRANGEEXCEPTION IMPL_INTERNAL_DOM_EXCEPTION_TAIL ( nsRangeException  ,
nsIDOMRangeException  ,
RangeException  ,
NS_ERROR_MODULE_DOM_RANGE  ,
NSResultToNameAndMessage   
)

Definition at line 154 of file nsDOMException.cpp.

{
  NS_ENSURE_ARG_POINTER(aCode);
  nsresult result;
  GetResult(&result);
  *aCode = NS_ERROR_GET_CODE(result);

  return NS_OK;
}
static void NSResultToNameAndMessage ( nsresult  aNSResult,
const char **  aName,
const char **  aMessage 
) [static]

Definition at line 114 of file nsDOMException.cpp.

{
  ResultStruct* result_struct = gDOMErrorMsgMap;

  while (result_struct->mName) {
    if (aNSResult == result_struct->mNSResult) {
      *aName = result_struct->mName;
      *aMessage = result_struct->mMessage;
      return;
    }

    ++result_struct;
  }

  NS_WARNING("Huh, someone is throwing non-DOM errors using the DOM module!");

  return;
}

Variable Documentation

struct ResultStruct gDOMErrorMsgMap[] [static]