Sha256: 1afbf36ac124c91bbb3258489e7488e3590bcc413068cb3832169c14831a6ed3

Contents?: true

Size: 642 Bytes

Versions: 36

Compression:

Stored size: 642 Bytes

Contents

//-*-c++-*-

!enum_cname! ruby2!enum_varname!(VALUE rval, int argn) {
  int cval = ruby2int(rval, argn);

  switch(cval) {
    !enum_cases!
      return static_cast<!enum_cname!>(cval);
    default:
      if( argn > 0)
        rb_raise(rb_eArgError, "value %d for enum !enum_name! is out of bound for argument %d", cval, argn);
      else
        rb_raise(rb_eArgError, "value %d for enum !enum_name! is out of bound", cval);
      return static_cast<!enum_cname!>(-1);
  }
}

bool is_!enum_varname!(VALUE rval) {
  if( is_int(rval) )
  {
    switch(ruby2int(rval))
    {
      !enum_cases!
        return true;
    }
  }
  
  return false;
}

Version data entries

36 entries across 36 versions & 2 rubygems

Version Path
gecoder-with-gecode-1.1.1.1 vendor/rust/rust/templates/EnumDefinitions.rusttpl
gecoder-with-gecode-1.1.1 vendor/rust/rust/templates/EnumDefinitions.rusttpl
gecoder-1.1.1 vendor/rust/rust/templates/EnumDefinitions.rusttpl
gecoder-with-gecode-1.1.0 vendor/rust/rust/templates/EnumDefinitions.rusttpl
gecoder-1.1.0 vendor/rust/rust/templates/EnumDefinitions.rusttpl
gecoder-with-gecode-0.8.3-mswin32 vendor/rust/rust/templates/EnumDefinitions.rusttpl
gecoder-with-gecode-0.8.2-mswin32 vendor/rust/rust/templates/EnumDefinitions.rusttpl
gecoder-with-gecode-0.8.1-mswin32 vendor/rust/rust/templates/EnumDefinitions.rusttpl
gecoder-with-gecode-0.8.0-mswin32 vendor/rust/rust/templates/EnumDefinitions.rusttpl
gecoder-with-gecode-0.7.1-mswin32 vendor/rust/rust/templates/EnumDefinitions.rusttpl
gecoder-0.5.0 vendor/rust/rust/templates/EnumDefinitions.rusttpl
gecoder-0.4.0 vendor/rust/rust/templates/EnumDefinitions.rusttpl
gecoder-0.3.0 vendor/rust/rust/templates/EnumDefinitions.rusttpl
gecoder-0.2.0 vendor/rust/rust/templates/EnumDefinitions.rusttpl
gecoder-0.8.2 vendor/rust/rust/templates/EnumDefinitions.rusttpl
gecoder-0.6.1 vendor/rust/rust/templates/EnumDefinitions.rusttpl
gecoder-0.6.0 vendor/rust/rust/templates/EnumDefinitions.rusttpl
gecoder-0.8.3 vendor/rust/rust/templates/EnumDefinitions.rusttpl
gecoder-0.7.0 vendor/rust/rust/templates/EnumDefinitions.rusttpl
gecoder-0.7.1 vendor/rust/rust/templates/EnumDefinitions.rusttpl