当前位置: 首页>>代码示例>>C++>>正文


C++ NativeMethodEnvironment::state方法代码示例

本文整理汇总了C++中NativeMethodEnvironment::state方法的典型用法代码示例。如果您正苦于以下问题:C++ NativeMethodEnvironment::state方法的具体用法?C++ NativeMethodEnvironment::state怎么用?C++ NativeMethodEnvironment::state使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NativeMethodEnvironment的用法示例。


在下文中一共展示了NativeMethodEnvironment::state方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: rb_intern

  ID rb_intern(const char* string) {
    NativeMethodEnvironment* env = NativeMethodEnvironment::get();

    return reinterpret_cast<ID>(env->state()->symbol(string));
  }
开发者ID:AndreMeira,项目名称:rubinius,代码行数:5,代码来源:object.cpp

示例2: rb_thread_current

  VALUE rb_thread_current(void) {
    NativeMethodEnvironment* env = NativeMethodEnvironment::get();
    Thread* thread = env->state()->vm()->thread.get();

    return env->get_handle(thread);
  }
开发者ID:Red54,项目名称:rubinius,代码行数:6,代码来源:thread.cpp

示例3: rb_reg_new

 VALUE rb_reg_new(const char *source, long len, int options) {
   NativeMethodEnvironment* env = NativeMethodEnvironment::get();
   String *pat = String::create(env->state(), source, len);
   return rb_funcall(rb_cRegexp, rb_intern("new"), 2, env->get_handle(pat), Fixnum::from(options));
 }
开发者ID:AndreMeira,项目名称:rubinius,代码行数:5,代码来源:regexp.cpp

示例4: rb_register_transcoder

  void rb_register_transcoder(const rb_transcoder* trans) {
    NativeMethodEnvironment* env = NativeMethodEnvironment::get();

    Transcoding::define(env->state(), (OnigTranscodingType*)trans);
  }
开发者ID:Emily,项目名称:rubinius,代码行数:5,代码来源:encoding.cpp

示例5: rb_set_kcode

  void rb_set_kcode(const char *code) {
    NativeMethodEnvironment* env = NativeMethodEnvironment::get();

    System::vm_set_kcode(env->state(), String::create(env->state(), code));
  }
开发者ID:Erreon,项目名称:rubinius,代码行数:5,代码来源:globals.cpp

示例6: rb_obj_encoding

 VALUE rb_obj_encoding(VALUE obj) {
   NativeMethodEnvironment* env = NativeMethodEnvironment::get();
   Object* val = env->get_object(obj);
   Encoding* enc = Encoding::get_object_encoding(env->state(), val);
   return env->get_handle(enc);
 }
开发者ID:Emily,项目名称:rubinius,代码行数:6,代码来源:encoding.cpp

示例7: rb_enc_from_encoding

  VALUE rb_enc_from_encoding(rb_encoding *enc) {
    NativeMethodEnvironment* env = NativeMethodEnvironment::get();

    return env->get_handle(Encoding::find(env->state(), enc->name));
  }
开发者ID:Emily,项目名称:rubinius,代码行数:5,代码来源:encoding.cpp

示例8: rb_str_length

  VALUE rb_str_length(VALUE self) {
    NativeMethodEnvironment* env = NativeMethodEnvironment::get();

    String* string = capi_get_string(env, self);
    return LONG2FIX(string->char_size(env->state()));
  }
开发者ID:driv3r,项目名称:rubinius,代码行数:6,代码来源:string.cpp

示例9: rb_singleton_class

  /** @todo   Should this be a global handle? Surely not.. --rue */
  VALUE rb_singleton_class(VALUE object_handle) {
    NativeMethodEnvironment* env = NativeMethodEnvironment::get();

    Class* sc = env->get_object(object_handle)->singleton_class(env->state());
    return env->get_handle(sc);
  }
开发者ID:JesseChavez,项目名称:rubinius,代码行数:7,代码来源:class.cpp

示例10: rb_str_dup

  VALUE rb_str_dup(VALUE self) {
    NativeMethodEnvironment* env = NativeMethodEnvironment::get();

    String* string = capi_get_string(env, self);
    return env->get_handle(string->string_dup(env->state()));
  }
开发者ID:driv3r,项目名称:rubinius,代码行数:6,代码来源:string.cpp

示例11: rb_str_new

  VALUE rb_str_new(const char* string, long length) {
    if(length < 0) rb_raise(rb_eArgError, "invalid string size");
    NativeMethodEnvironment* env = NativeMethodEnvironment::get();

    return env->get_handle(String::create(env->state(), string, length));
  }
开发者ID:driv3r,项目名称:rubinius,代码行数:6,代码来源:string.cpp

示例12: rb_str_modify

  void rb_str_modify(VALUE self) {
    NativeMethodEnvironment* env = NativeMethodEnvironment::get();

    String* string = capi_get_string(env, self);
    string->unshare(env->state());
  }
开发者ID:driv3r,项目名称:rubinius,代码行数:6,代码来源:string.cpp

示例13:

  char* rb_class2name(VALUE class_handle) {
    NativeMethodEnvironment* env = NativeMethodEnvironment::get();
    Class* class_object = c_as<Class>(env->get_object(class_handle));

    return ::strdup(class_object->name()->c_str(env->state()));
  }
开发者ID:,项目名称:,代码行数:6,代码来源:

示例14: rb_class_name

 VALUE rb_class_name(VALUE class_handle) {
   NativeMethodEnvironment* env = NativeMethodEnvironment::get();
   Class* class_object = c_as<Class>(env->get_object(class_handle));
   return env->get_handle(class_object->name()->to_str(env->state()));
 }
开发者ID:,项目名称:,代码行数:5,代码来源:

示例15: rb_obj_freeze

 VALUE rb_obj_freeze(VALUE hndl) {
   NativeMethodEnvironment* env = NativeMethodEnvironment::get();
   env->get_object(hndl)->freeze(env->state());
   return hndl;
 }
开发者ID:AndreMeira,项目名称:rubinius,代码行数:5,代码来源:object.cpp


注:本文中的NativeMethodEnvironment::state方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。