class Fox::FXDict

Public Class Methods

new(*args) click to toggle source
SWIGINTERN VALUE
_wrap_new_FXDict(int argc, VALUE *argv, VALUE self) {
  FXDict *result = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  {
    result = (FXDict *)new_FXDict();
    DATA_PTR(self) = result; FXRbRegisterRubyObj(self, result);
    if(rb_block_given_p()){
      rb_yield(self);
    }
  }
  return self;
fail:
  return Qnil;
}

Public Instance Methods

clear(*args) click to toggle source
SWIGINTERN VALUE
_wrap_FXDict_clear(int argc, VALUE *argv, VALUE self) {
  FXDict *arg1 = (FXDict *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_FXDict, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXDict *","clear", 1, self )); 
  }
  arg1 = reinterpret_cast< FXDict * >(argp1);
  (arg1)->clear();
  return Qnil;
fail:
  return Qnil;
}
each_key() { |key(pos)| ... } click to toggle source

Iterate over the keys in this dictionary.

# File lib/fox16/dict.rb, line 19
def each_key
  pos = first
  while pos < self.getTotalSize()
    yield key(pos)
    pos = self.next(pos)
  end
end
empty?() click to toggle source

Returns true if this dictionary contains no key-value pairs.

# File lib/fox16/dict.rb, line 30
def empty?
  self.size == 0
end
first → FXint click to toggle source

Return the first element in FXDict.

SWIGINTERN VALUE
_wrap_FXDict_first(int argc, VALUE *argv, VALUE self) {
  FXDict *arg1 = (FXDict *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  FXint result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_FXDict, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXDict const *","first", 1, self )); 
  }
  arg1 = reinterpret_cast< FXDict * >(argp1);
  result = (FXint)((FXDict const *)arg1)->first();
  vresult = SWIG_From_int(static_cast< int >(result));
  return vresult;
fail:
  return Qnil;
}
getTotalSize → FXint click to toggle source

Size or Length of the FXDict.

SWIGINTERN VALUE
_wrap_FXDict_getTotalSize(int argc, VALUE *argv, VALUE self) {
  FXDict *arg1 = (FXDict *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  FXint result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_FXDict, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXDict const *","size", 1, self )); 
  }
  arg1 = reinterpret_cast< FXDict * >(argp1);
  result = (FXint)((FXDict const *)arg1)->size();
  vresult = SWIG_From_int(static_cast< int >(result));
  return vresult;
fail:
  return Qnil;
}
has_key?(*args) click to toggle source
SWIGINTERN VALUE
_wrap_FXDict_has_keyq___(int argc, VALUE *argv, VALUE self) {
  FXDict *arg1 = (FXDict *) 0 ;
  FXchar *arg2 = (FXchar *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_FXDict, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXDict const *","has_key", 1, self )); 
  }
  arg1 = reinterpret_cast< FXDict * >(argp1);
  arg2 = NIL_P(argv[0]) ? 0 : StringValuePtr(argv[0]);
  result = (bool)FXDict_has_key((FXDict const *)arg1,(char const *)arg2);
  vresult = (result ? Qtrue : Qfalse);
  return vresult;
fail:
  return Qnil;
}
key(*args) click to toggle source
SWIGINTERN VALUE
_wrap_FXDict_key(int argc, VALUE *argv, VALUE self) {
  FXDict *arg1 = (FXDict *) 0 ;
  FXuint arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  FXchar *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_FXDict, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXDict const *","key", 1, self )); 
  }
  arg1 = reinterpret_cast< FXDict * >(argp1);
  arg2 = NUM2UINT(argv[0]);
  result = (FXchar *)((FXDict const *)arg1)->key(arg2);
  vresult = SWIG_FromCharPtr((const char *)result);
  return vresult;
fail:
  return Qnil;
}
keys() click to toggle source

Returns a new array populated with the keys from this dictionary.

# File lib/fox16/dict.rb, line 10
def keys
  ary = []
  each_key { |k| ary << k }
  ary
end
last → FXint click to toggle source

Return the last element in FXDict.

SWIGINTERN VALUE
_wrap_FXDict_last(int argc, VALUE *argv, VALUE self) {
  FXDict *arg1 = (FXDict *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  FXint result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_FXDict, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXDict const *","last", 1, self )); 
  }
  arg1 = reinterpret_cast< FXDict * >(argp1);
  result = (FXint)((FXDict const *)arg1)->last();
  vresult = SWIG_From_int(static_cast< int >(result));
  return vresult;
fail:
  return Qnil;
}
length(*args) click to toggle source
SWIGINTERN VALUE
_wrap_FXDict_length(int argc, VALUE *argv, VALUE self) {
  FXDict *arg1 = (FXDict *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  FXint result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_FXDict, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXDict const *","no", 1, self )); 
  }
  arg1 = reinterpret_cast< FXDict * >(argp1);
  result = (FXint)((FXDict const *)arg1)->no();
  vresult = SWIG_From_int(static_cast< int >(result));
  return vresult;
fail:
  return Qnil;
}
load(*args) click to toggle source
SWIGINTERN VALUE
_wrap_FXDict_load(int argc, VALUE *argv, VALUE self) {
  FXDict *arg1 = (FXDict *) 0 ;
  FXStream *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_FXDict, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXDict *","load", 1, self )); 
  }
  arg1 = reinterpret_cast< FXDict * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_FXStream,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "FXStream &","load", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "FXStream &","load", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< FXStream * >(argp2);
  FXDict_load(arg1,*arg2);
  return Qnil;
fail:
  return Qnil;
}
mark(*args) click to toggle source
SWIGINTERN VALUE
_wrap_FXDict_mark(int argc, VALUE *argv, VALUE self) {
  FXDict *arg1 = (FXDict *) 0 ;
  FXuint arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_FXDict, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXDict const *","mark", 1, self )); 
  }
  arg1 = reinterpret_cast< FXDict * >(argp1);
  arg2 = NUM2UINT(argv[0]);
  result = (bool)((FXDict const *)arg1)->mark(arg2);
  vresult = SWIG_From_bool(static_cast< bool >(result));
  return vresult;
fail:
  return Qnil;
}
next(*args) click to toggle source
SWIGINTERN VALUE
_wrap_FXDict_next(int argc, VALUE *argv, VALUE self) {
  FXDict *arg1 = (FXDict *) 0 ;
  FXint arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  FXint result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_FXDict, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXDict const *","next", 1, self )); 
  }
  arg1 = reinterpret_cast< FXDict * >(argp1);
  arg2 = NUM2INT(argv[0]);
  result = (FXint)((FXDict const *)arg1)->next(arg2);
  vresult = SWIG_From_int(static_cast< int >(result));
  return vresult;
fail:
  return Qnil;
}
prev(*args) click to toggle source
SWIGINTERN VALUE
_wrap_FXDict_prev(int argc, VALUE *argv, VALUE self) {
  FXDict *arg1 = (FXDict *) 0 ;
  FXint arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  FXint result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_FXDict, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXDict const *","prev", 1, self )); 
  }
  arg1 = reinterpret_cast< FXDict * >(argp1);
  arg2 = NUM2INT(argv[0]);
  result = (FXint)((FXDict const *)arg1)->prev(arg2);
  vresult = SWIG_From_int(static_cast< int >(result));
  return vresult;
fail:
  return Qnil;
}
remove(*args) click to toggle source
SWIGINTERN VALUE
_wrap_FXDict_remove(int argc, VALUE *argv, VALUE self) {
  FXDict *arg1 = (FXDict *) 0 ;
  FXchar *arg2 = (FXchar *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_FXDict, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXDict *","remove", 1, self )); 
  }
  arg1 = reinterpret_cast< FXDict * >(argp1);
  arg2 = NIL_P(argv[0]) ? 0 : StringValuePtr(argv[0]);
  result = (void *)(arg1)->remove((FXchar const *)arg2);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
  return vresult;
fail:
  return Qnil;
}
save(*args) click to toggle source
SWIGINTERN VALUE
_wrap_FXDict_save(int argc, VALUE *argv, VALUE self) {
  FXDict *arg1 = (FXDict *) 0 ;
  FXStream *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_FXDict, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXDict const *","save", 1, self )); 
  }
  arg1 = reinterpret_cast< FXDict * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_FXStream,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "FXStream &","save", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "FXStream &","save", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< FXStream * >(argp2);
  FXDict_save((FXDict const *)arg1,*arg2);
  return Qnil;
fail:
  return Qnil;
}
setTotalSize(m) click to toggle source

Size or Length of the FXDict.

SWIGINTERN VALUE
_wrap_FXDict_setTotalSize(int argc, VALUE *argv, VALUE self) {
  FXDict *arg1 = (FXDict *) 0 ;
  FXint arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_FXDict, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXDict *","size", 1, self )); 
  }
  arg1 = reinterpret_cast< FXDict * >(argp1);
  arg2 = NUM2INT(argv[0]);
  (arg1)->size(arg2);
  return Qnil;
fail:
  return Qnil;
}