ifndef Rice__Identifier__hpp_ define Rice__Identifier__hpp_
include “detail/ruby.hpp” include <string>
namespace Rice {
class Symbol;
//! A wrapper for the ID type
! An ID is ruby's internal representation of a Symbol object.
class Identifier { public:
//! Construct a new Identifier from an ID.
Identifier(ID id);
//! Construct a new Identifier from a Symbol.
Identifier(Symbol const & symbol);
//! Construct a new Identifier from a string.
Identifier(char const * s = "");
//! Return a string representation of the Identifier.
char const * c_str() const;
//! Return a string representation of the Identifier.
std::string str() const;
//! Return the underlying ID
ID id() const { return id_; }
//! Return the underlying ID
operator ID() const { return id_; }
//! Return the ID as a Symbol
VALUE to_sym() const;
private:
ID id_;
};
} // namespace Rice
include “Identifier.ipp”
endif // Rice__Identifier__hpp_