Beispiel #1
0
 public static RubyArray /*!*/ ReadLines(RubyContext /*!*/ context, StringIO /*!*/ self, [DefaultProtocol, NotNull] Union <MutableString, int> separatorOrLimit)
 {
     if (separatorOrLimit.IsFixnum())
     {
         return(ReadLines(self, context.InputSeparator, separatorOrLimit.Fixnum()));
     }
     else
     {
         return(ReadLines(self, separatorOrLimit.String(), -1));
     }
 }
Beispiel #2
0
 public static object EachLine(RubyContext /*!*/ context, BlockParam block, StringIO /*!*/ self, [DefaultProtocol, NotNull] Union <MutableString, int> separatorOrLimit)
 {
     if (separatorOrLimit.IsFixnum())
     {
         return(EachLine(block, self, context.InputSeparator, separatorOrLimit.Fixnum()));
     }
     else
     {
         return(EachLine(block, self, separatorOrLimit.String(), -1));
     }
 }
Beispiel #3
0
 public static MutableString /*!*/ ReadLine(RubyScope /*!*/ scope, StringIO /*!*/ self, [DefaultProtocol, NotNull] Union <MutableString, int> separatorOrLimit)
 {
     if (separatorOrLimit.IsFixnum())
     {
         return(ReadLine(scope, self, scope.RubyContext.InputSeparator, separatorOrLimit.Fixnum()));
     }
     else
     {
         return(ReadLine(scope, self, separatorOrLimit.String(), -1));
     }
 }
Beispiel #4
0
 public static RubyFile /*!*/ CreateFile(RubyClass /*!*/ self,
                                         [DefaultProtocol, NotNull] Union <int, MutableString> descriptorOrPath, int mode, [Optional] int permission)
 {
     if (descriptorOrPath.IsFixnum())
     {
         return(new RubyFile(
                    self.Context, RubyIOOps.GetDescriptorStream(self.Context, descriptorOrPath.Fixnum()), descriptorOrPath.Fixnum(), (IOMode)mode
                    ));
     }
     else
     {
         // TODO: permissions
         return(CreateFile(self, descriptorOrPath.Second, mode));
     }
 }