class Fox::FXStream

Public Class Methods

new(*args) click to toggle source
SWIGINTERN VALUE
_wrap_new_FXStream(int argc, VALUE *argv, VALUE self) {
  FXObject *arg1 = (FXObject *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  FXStream *result = 0 ;
  
  if ((argc < 0) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  if (argc > 0) {
    res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_FXObject, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXObject const *","FXStream", 1, argv[0] )); 
    }
    arg1 = reinterpret_cast< FXObject * >(argp1);
  }
  {
    result = (FXStream *)new_FXStream((FXObject const *)arg1);
    DATA_PTR(self) = result; FXRbRegisterRubyObj(self, result);
    if(rb_block_given_p()){
      rb_yield(self);
    }
  }
  return self;
fail:
  return Qnil;
}
new(*args, &blk) click to toggle source
# File lib/fox16/kwargs.rb, line 521
def initialize(*args, &blk)
  argument_names = %w{cont}
  default_params = { :cont => nil }
  params = {}
  params = args.pop if args.last.is_a? Hash
  args.each_with_index { |e, i| params[argument_names[i].intern] = e }
  params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) }
  params = default_params.merge(params)
  old_initialize(params[:cont], &blk)
end
Also aliased as: old_initialize

Public Instance Methods

close(*args) click to toggle source
SWIGINTERN VALUE
_wrap_FXStream_close(int argc, VALUE *argv, VALUE self) {
  FXStream *arg1 = (FXStream *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  bool 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_FXStream, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXStream *","close", 1, self )); 
  }
  arg1 = reinterpret_cast< FXStream * >(argp1);
  result = (bool)FXStream_close(arg1);
  vresult = SWIG_From_bool(static_cast< bool >(result));
  return vresult;
fail:
  return Qnil;
}
container(*args) click to toggle source
SWIGINTERN VALUE
_wrap_FXStream_container(int argc, VALUE *argv, VALUE self) {
  FXStream *arg1 = (FXStream *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  FXObject *result = 0 ;
  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_FXStream, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXStream const *","container", 1, self )); 
  }
  arg1 = reinterpret_cast< FXStream * >(argp1);
  result = (FXObject *)((FXStream const *)arg1)->container();
  {
    swig_type_info *ty = SWIG_TypeDynamicCast(SWIGTYPE_p_FXObject, (void **) &result);
    vresult = FXRbGetRubyObj(result, ty);
  }
  return vresult;
fail:
  return Qnil;
}
direction(*args) click to toggle source
SWIGINTERN VALUE
_wrap_FXStream_direction(int argc, VALUE *argv, VALUE self) {
  FXStream *arg1 = (FXStream *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  FXStreamDirection 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_FXStream, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXStream const *","direction", 1, self )); 
  }
  arg1 = reinterpret_cast< FXStream * >(argp1);
  result = (FXStreamDirection)((FXStream const *)arg1)->direction();
  vresult = SWIG_From_int(static_cast< int >(result));
  return vresult;
fail:
  return Qnil;
}
eof?(*args) click to toggle source
SWIGINTERN VALUE
_wrap_FXStream_eofq___(int argc, VALUE *argv, VALUE self) {
  FXStream *arg1 = (FXStream *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  bool 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_FXStream, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXStream const *","eof", 1, self )); 
  }
  arg1 = reinterpret_cast< FXStream * >(argp1);
  result = (bool)((FXStream const *)arg1)->eof();
  vresult = SWIG_From_bool(static_cast< bool >(result));
  return vresult;
fail:
  return Qnil;
}
flush(*args) click to toggle source
SWIGINTERN VALUE
_wrap_FXStream_flush(int argc, VALUE *argv, VALUE self) {
  FXStream *arg1 = (FXStream *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  bool 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_FXStream, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXStream *","flush", 1, self )); 
  }
  arg1 = reinterpret_cast< FXStream * >(argp1);
  result = (bool)FXStream_flush(arg1);
  vresult = SWIG_From_bool(static_cast< bool >(result));
  return vresult;
fail:
  return Qnil;
}
getPosition(*args) click to toggle source
SWIGINTERN VALUE
_wrap_FXStream_getPosition(int argc, VALUE *argv, VALUE self) {
  FXStream *arg1 = (FXStream *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  FXlong 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_FXStream, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXStream const *","position", 1, self )); 
  }
  arg1 = reinterpret_cast< FXStream * >(argp1);
  result = ((FXStream const *)arg1)->position();
  vresult = LONG2NUM(result);
  return vresult;
fail:
  return Qnil;
}
getSpace(*args) click to toggle source
SWIGINTERN VALUE
_wrap_FXStream_getSpace(int argc, VALUE *argv, VALUE self) {
  FXStream *arg1 = (FXStream *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  FXuval 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_FXStream, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXStream const *","getSpace", 1, self )); 
  }
  arg1 = reinterpret_cast< FXStream * >(argp1);
  result = (FXuval)((FXStream const *)arg1)->getSpace();
  vresult = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result));
  return vresult;
fail:
  return Qnil;
}
isBigEndian(*args) click to toggle source
SWIGINTERN VALUE
_wrap_FXStream_isBigEndian(int argc, VALUE *argv, VALUE self) {
  FXStream *arg1 = (FXStream *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  bool 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_FXStream, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXStream const *","isBigEndian", 1, self )); 
  }
  arg1 = reinterpret_cast< FXStream * >(argp1);
  result = (bool)((FXStream const *)arg1)->isBigEndian();
  vresult = SWIG_From_bool(static_cast< bool >(result));
  return vresult;
fail:
  return Qnil;
}
old_initialize(*args, &blk)
Alias for: new
open(*args) click to toggle source
SWIGINTERN VALUE
_wrap_FXStream_open(int argc, VALUE *argv, VALUE self) {
  FXStream *arg1 = (FXStream *) 0 ;
  FXStreamDirection arg2 ;
  FXuval arg3 = (FXuval) 8192 ;
  FXuchar *arg4 = (FXuchar *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  unsigned long val3 ;
  int ecode3 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_FXStream, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXStream *","open", 1, self )); 
  }
  arg1 = reinterpret_cast< FXStream * >(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "FXStreamDirection","open", 2, argv[0] ));
  } 
  arg2 = static_cast< FXStreamDirection >(val2);
  if (argc > 1) {
    ecode3 = SWIG_AsVal_unsigned_SS_long(argv[1], &val3);
    if (!SWIG_IsOK(ecode3)) {
      SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "FXuval","open", 3, argv[1] ));
    } 
    arg3 = static_cast< FXuval >(val3);
  }
  if (argc > 2) {
    arg4 = NIL_P(argv[2]) ? 0 : reinterpret_cast<FXuchar*>(StringValuePtr(argv[2]));
  }
  result = (bool)(arg1)->open(arg2,arg3,arg4);
  vresult = SWIG_From_bool(static_cast< bool >(result));
  return vresult;
fail:
  return Qnil;
}
setBigEndian(*args) click to toggle source
SWIGINTERN VALUE
_wrap_FXStream_setBigEndian(int argc, VALUE *argv, VALUE self) {
  FXStream *arg1 = (FXStream *) 0 ;
  bool arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  bool val2 ;
  int ecode2 = 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_FXStream, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXStream *","setBigEndian", 1, self )); 
  }
  arg1 = reinterpret_cast< FXStream * >(argp1);
  ecode2 = SWIG_AsVal_bool(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "bool","setBigEndian", 2, argv[0] ));
  } 
  arg2 = static_cast< bool >(val2);
  (arg1)->setBigEndian(arg2);
  return Qnil;
fail:
  return Qnil;
}
setError(*args) click to toggle source
SWIGINTERN VALUE
_wrap_FXStream_setError(int argc, VALUE *argv, VALUE self) {
  FXStream *arg1 = (FXStream *) 0 ;
  FXStreamStatus arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 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_FXStream, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXStream *","setError", 1, self )); 
  }
  arg1 = reinterpret_cast< FXStream * >(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "FXStreamStatus","setError", 2, argv[0] ));
  } 
  arg2 = static_cast< FXStreamStatus >(val2);
  (arg1)->setError(arg2);
  return Qnil;
fail:
  return Qnil;
}
setPosition(*args) click to toggle source
SWIGINTERN VALUE
_wrap_FXStream_setPosition(int argc, VALUE *argv, VALUE self) {
  FXStream *arg1 = (FXStream *) 0 ;
  FXlong arg2 ;
  FXWhence arg3 = (FXWhence) FXFromStart ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_FXStream, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXStream *","position", 1, self )); 
  }
  arg1 = reinterpret_cast< FXStream * >(argp1);
  arg2 = static_cast<FXlong>(NUM2LONG(argv[0]));
  if (argc > 1) {
    ecode3 = SWIG_AsVal_int(argv[1], &val3);
    if (!SWIG_IsOK(ecode3)) {
      SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "FXWhence","position", 3, argv[1] ));
    } 
    arg3 = static_cast< FXWhence >(val3);
  }
  result = (bool)FXStream_position(arg1,arg2,arg3);
  vresult = SWIG_From_bool(static_cast< bool >(result));
  return vresult;
fail:
  return Qnil;
}
setSpace(*args) click to toggle source
SWIGINTERN VALUE
_wrap_FXStream_setSpace(int argc, VALUE *argv, VALUE self) {
  FXStream *arg1 = (FXStream *) 0 ;
  FXuval arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned long val2 ;
  int ecode2 = 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_FXStream, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXStream *","setSpace", 1, self )); 
  }
  arg1 = reinterpret_cast< FXStream * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_long(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "FXuval","setSpace", 2, argv[0] ));
  } 
  arg2 = static_cast< FXuval >(val2);
  (arg1)->setSpace(arg2);
  return Qnil;
fail:
  return Qnil;
}
status(*args) click to toggle source
SWIGINTERN VALUE
_wrap_FXStream_status(int argc, VALUE *argv, VALUE self) {
  FXStream *arg1 = (FXStream *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  FXStreamStatus 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_FXStream, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXStream const *","status", 1, self )); 
  }
  arg1 = reinterpret_cast< FXStream * >(argp1);
  result = (FXStreamStatus)((FXStream const *)arg1)->status();
  vresult = SWIG_From_int(static_cast< int >(result));
  return vresult;
fail:
  return Qnil;
}
swapBytes(*args) click to toggle source
SWIGINTERN VALUE _wrap_FXStream_swapBytes(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[3];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 3) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_FXStream, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_FXStream_swapBytes__SWIG_1(nargs, args, self);
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_FXStream, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_bool(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_FXStream_swapBytes__SWIG_0(nargs, args, self);
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 3, "FXStream.swapBytes", 
    "    void FXStream.swapBytes(bool s)\n"
    "    bool FXStream.swapBytes()\n");
  
  return Qnil;
}