Rice
3.0.0
|
A placeholder for Ruby exceptions. More...
#include <Exception_defn.hpp>
Public Member Functions | |
Exception (VALUE e) | |
Construct a Exception with the exception e. | |
Exception (Exception const &other) | |
Copy constructor. | |
Exception (Object exc, char const *fmt,...) | |
Construct a Exception with printf-style formatting. More... | |
virtual | ~Exception () throw () |
Destructor. | |
String | message () const |
Get the message the exception holds. More... | |
virtual char const * | what () const throw () |
Get message as a char const *. More... | |
![]() | |
Exception_Base (VALUE v) | |
![]() | |
Object (VALUE value=Qnil) | |
Encapsulate an existing ruby object. | |
Object (Object const &other) | |
Copy constructor. | |
virtual | ~Object () |
Destructor. | |
bool | test () const |
operator bool () const | |
bool | is_nil () const |
Returns true if the object is nil, false otherwise. | |
operator VALUE () const | |
Implicit conversion to VALUE. | |
VALUE const volatile & | value () const |
Explicitly get the encapsulated VALUE. | |
Class | class_of () const |
Get the class of an object. More... | |
int | compare (Object const &other) const |
Compare this object to another object. More... | |
String | to_s () const |
Return a string representation of an object. More... | |
String | inspect () const |
Inspect the object. More... | |
void | freeze () |
Freeze the object. | |
bool | is_frozen () const |
Determine if the object is frozen. More... | |
void | swap (Object &other) |
Swap with another Object. | |
Object | instance_eval (String const &s) |
Evaluate the given string in the context of the object. More... | |
int | rb_type () const |
Return the type of the underlying C object. More... | |
bool | is_a (Object klass) const |
Determine whether the object is an instance of a class/module. More... | |
bool | respond_to (Identifier id) const |
Determine if the objects responds to a method. More... | |
bool | is_instance_of (Object klass) const |
Determine whether class is the object's class. More... | |
template<typename T > | |
void | iv_set (Identifier name, T const &value) |
Set an instance variable. More... | |
Object | iv_get (Identifier name) const |
Get the value of an instance variable. More... | |
Object | attr_get (Identifier name) const |
Get the value of an instance variable, but don't warn if it is. More... | |
template<typename ... ArgT> | |
Object | call (Identifier id, ArgT... args) const |
Call the Ruby method specified by 'id' on object 'obj'. More... | |
Object | vcall (Identifier id, Array args) |
Vectorized call. More... | |
void | mark () const |
Mark the object with the garbage collector. | |
Additional Inherited Members | |
![]() | |
void | set_value (VALUE v) |
Set the encapsulated value. | |
template<typename ... ArgT> | |
std::vector< VALUE > | convert_args (ArgT &... args) const |
Unpack the provided arguments and convert them all to Ruby types. | |
A placeholder for Ruby exceptions.
You can use this to safely throw a Ruby exception using C++ syntax:
Rice::Exception::Exception | ( | Object | exc, |
char const * | fmt, | ||
... | |||
) |
String Rice::Exception::message | ( | ) | const |
Get the message the exception holds.
|
virtual |
Get message as a char const *.
If message is a non-string object, then this function will attempt to throw an exception (which it can't do because of the no-throw specification).
Implements Rice::Exception_Base.