Rice  1.5.2
 All Classes Files Functions Variables Typedefs Friends Pages
Identifier.hpp
1 #ifndef Rice__Identifier__hpp_
2 #define Rice__Identifier__hpp_
3 
4 #include "detail/ruby.hpp"
5 #include <string>
6 
7 namespace Rice
8 {
9 
10 class Symbol;
11 
13 
16 {
17 public:
19  Identifier(ID id);
20 
22  Identifier(Symbol const & symbol);
23 
25  Identifier(char const * s = "");
26 
28  char const * c_str() const;
29 
31  std::string str() const;
32 
34  ID id() const { return id_; }
35 
37  operator ID() const { return id_; }
38 
40  VALUE to_sym() const;
41 
42 private:
43  ID id_;
44 };
45 
46 } // namespace Rice
47 
48 #include "Identifier.ipp"
49 
50 #endif // Rice__Identifier__hpp_
char const * c_str() const
Return a string representation of the Identifier.
A wrapper for the ID type.
Definition: Identifier.hpp:15
Identifier(ID id)
Construct a new Identifier from an ID.
ID id() const
Return the underlying ID.
Definition: Identifier.hpp:34
std::string str() const
Return a string representation of the Identifier.
A wrapper for ruby&#39;s Symbol class.
Definition: Symbol.hpp:18
VALUE to_sym() const
Return the ID as a Symbol.