Sha256: 40aea0d0c34a5110a975057215ae49c50a214f2e2d7e448e0b6dd00190f975bb

Contents?: true

Size: 1.06 KB

Versions: 3

Compression:

Stored size: 1.06 KB

Contents

#ifndef Rice__Identifier__hpp_
#define Rice__Identifier__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 c string.
    Identifier(char const* s);

    //! Construct a new Identifier from a string.
    Identifier(std::string const& string);

    //! 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_

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rice-4.3.3 rice/Identifier.hpp
rice-4.3.2 rice/Identifier.hpp
rice-4.3.1 rice/Identifier.hpp