AVPKit
com::avpkit::core::Error Class Reference
Inheritance diagram for com::avpkit::core::Error:
Collaboration diagram for com::avpkit::core::Error:

Public Member Functions

virtual const char * getDescription ()
 Get a text description for this error. More...
 
virtual int32_t getErrorNumber ()
 Return the raw integer value that AVPKit returned and was used to create this IError. More...
 
virtual Type getType ()
 Get the OS-independent AVPKit type for this error. More...
 
- Public Member Functions inherited from com::avpkit::ferry::RefCounted
virtual int32_t acquire ()
 Internal Only. More...
 
virtual int32_t release ()
 Internal Only. More...
 
virtual RefCountedcopyReference ()
 Create a new Java object that refers to the same native object. More...
 
virtual int32_t getCurrentRefCount ()
 Return the current reference count on this object. More...
 
void setJavaAllocator (void *allocator)
 This method is public but not part of the standard API. More...
 
void * getJavaAllocator ()
 This method is public but not part of the standard API. More...
 

Static Public Member Functions

static Errormake (int32_t errNo)
 
static Errormake (Type type)
 
static Type errorNumberToType (int32_t errorNo)
 
static int32_t typeToErrorNumber (Type type)
 
- Static Public Member Functions inherited from com::avpkit::core::IError
static IErrormake (int32_t errorNumber)
 Create a new IError object from a return value passed in from AVPKit. More...
 
static IErrormake (Type type)
 Create a new IError object from an IError.Type enum value. More...
 
static Type errorNumberToType (int32_t errorNo)
 Translate an error number to a type. More...
 
static int32_t typeToErrorNumber (Type type)
 Translate an a type to an error number. More...
 

Additional Inherited Members

- Public Types inherited from com::avpkit::core::IError
enum  Type {
  ERROR_UNKNOWN , ERROR_IO , ERROR_NUMEXPECTED , ERROR_INVALIDDATA ,
  ERROR_NOMEM , ERROR_NOFMT , ERROR_NOTSUPPORTED , ERROR_NOENT ,
  ERROR_EOF , ERROR_RANGE , ERROR_AGAIN , ERROR_PATCHWELCOME ,
  ERROR_INTERRUPTED
}
 A set of errors that AVPKit knows about.
 
typedef enum com::avpkit::core::IError::Type Type
 A set of errors that AVPKit knows about.
 
- Protected Member Functions inherited from com::avpkit::ferry::RefCounted
virtual void destroy ()
 This method is called by RefCounted objects when their Ref Count reaches zero and they are about to be destroyed.
 
- Protected Attributes inherited from com::avpkit::ferry::RefCounted
AtomicIntegermRefCount
 This is the internal reference count, represented as an AtomicInteger to make sure it is thread safe.
 
void * mAllocator
 Not part of public API.
 

Detailed Description

Definition at line 35 of file Error.h.

Member Function Documentation

◆ getDescription()

const char * com::avpkit::core::Error::getDescription ( )
virtual

Get a text description for this error.

The description returned will be in whatever language the underlying OS decides to use, and no, we can't support localization here if the OS hasn't already done it.

Sorry.

Returns
the description.

Implements com::avpkit::core::IError.

Definition at line 80 of file Error.cpp.

81 {
82  const char* retval = 0;
83  if (!*mErrorStr && mErrorNo != 0)
84  {
85 #ifdef HAVE_STRERROR_R
86 #ifdef STRERROR_R_CHAR_P
87  retval = strerror_r(AVUNERROR(mErrorNo), mErrorStr, sizeof(mErrorStr));
88 #else
89  strerror_r(AVUNERROR(mErrorNo), mErrorStr, sizeof(mErrorStr));
90  retval = mErrorStr;
91 #endif
92 #else
93  retval = strerror(AVUNERROR(mErrorNo));
94 #endif // HAVE_STRERROR_R
95  if (retval != (const char*) mErrorStr)
96  strncpy(mErrorStr, retval, sizeof(mErrorStr)-1);
97  }
98  return *mErrorStr ? mErrorStr : 0;
99 }

◆ getErrorNumber()

int32_t com::avpkit::core::Error::getErrorNumber ( )
virtual

Return the raw integer value that AVPKit returned and was used to create this IError.

Note that this value can have different meanings on different operating systems. Use getType() instead for programmatic decisions.

Returns
the native error number.

Implements com::avpkit::core::IError.

Definition at line 102 of file Error.cpp.

103 {
104  return mErrorNo;
105 }

◆ getType()

IError::Type com::avpkit::core::Error::getType ( )
virtual

Get the OS-independent AVPKit type for this error.

Returns
the type.

Implements com::avpkit::core::IError.

Definition at line 107 of file Error.cpp.

108 {
109  return mType;
110 }

The documentation for this class was generated from the following files: