Sha256: f1e635d00178bec3595f061f075c1209ebe4461d09e0fa305b2a31a5e968720d

Contents?: true

Size: 1.05 KB

Versions: 8

Compression:

Stored size: 1.05 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

8 entries across 8 versions & 1 rubygems

Version Path
rice-4.2.1 rice/Identifier.hpp
rice-4.2.0 rice/Identifier.hpp
rice-4.1.0 rice/Identifier.hpp
rice-4.0.4 rice/Identifier.hpp
rice-4.0.3 rice/Identifier.hpp
rice-4.0.2 rice/Identifier.hpp
rice-4.0.1 rice/Identifier.hpp
rice-4.0.0 rice/Identifier.hpp