public static RubyIO /*!*/ Reinitialize(RubyIO /*!*/ self, [DefaultProtocol] int descriptor, int mode) { self.Mode = (IOMode)mode; self.SetStream(GetDescriptorStream(self.Context, descriptor)); self.SetFileDescriptor(descriptor); return(self); }
public static RubyIO /*!*/ Reopen(RubyIO /*!*/ self, [NotNull] RubyIO /*!*/ source) { self.Context.RedirectFileDescriptor(self.GetFileDescriptor(), source.GetFileDescriptor()); self.SetStream(source.GetStream()); self.Mode = source.Mode; return(self); }
public static RubyIO /*!*/ Reopen(RubyIO /*!*/ self, [DefaultProtocol, NotNull] MutableString /*!*/ path, int mode) { Stream newStream = RubyFile.OpenFileStream(self.Context, path.ConvertToString(), (IOMode)mode); self.Context.SetStream(self.GetFileDescriptor(), newStream); self.SetStream(newStream); self.Mode = (IOMode)mode; return(self); }
public static RubyIO /*!*/ InitializeCopy(RubyIO /*!*/ self, [NotNull] RubyIO /*!*/ source) { Stream stream = source.GetStream(); int descriptor = self.Context.DuplicateFileDescriptor(source.GetFileDescriptor()); self.SetStream(stream); self.SetFileDescriptor(descriptor); self.Mode = source.Mode; return(self); }
private static RubyIO/*!*/ Reopen(ConversionStorage<MutableString>/*!*/ toPath, RubyIO/*!*/ io, object pathObj, IOInfo info) { MutableString path = Protocols.CastToPath(toPath, pathObj); Stream newStream = RubyFile.OpenFileStream(io.Context, path.ToString(path.Encoding.Encoding), info.Mode); io.Context.SetStream(io.GetFileDescriptor(), newStream); io.SetStream(newStream); io.Mode = info.Mode; if (info.HasEncoding) { io.ExternalEncoding = info.ExternalEncoding; io.InternalEncoding = info.InternalEncoding; } return io; }
public static RubyIO/*!*/ Reopen(RubyIO/*!*/ self, [NotNull]RubyIO/*!*/ source) { self.Context.RedirectFileDescriptor(self.GetFileDescriptor(), source.GetFileDescriptor()); self.SetStream(source.GetStream()); self.Mode = source.Mode; return self; }
public static RubyIO/*!*/ InitializeCopy(RubyIO/*!*/ self, [NotNull]RubyIO/*!*/ source) { Stream stream = source.GetStream(); int descriptor = self.Context.DuplicateFileDescriptor(source.GetFileDescriptor()); self.SetStream(stream); self.SetFileDescriptor(descriptor); self.Mode = source.Mode; self.ExternalEncoding = source.ExternalEncoding; self.InternalEncoding = source.InternalEncoding; return self; }
internal static RubyIO/*!*/ Reinitialize(RubyIO/*!*/ io, int descriptor, IOInfo info) { io.Mode = info.Mode; io.SetStream(GetDescriptorStream(io.Context, descriptor)); io.SetFileDescriptor(descriptor); if (info.HasEncoding) { io.ExternalEncoding = info.ExternalEncoding; io.InternalEncoding = info.InternalEncoding; } return io; }
public static RubyIO/*!*/ Reinitialize(RubyIO/*!*/ self, [DefaultProtocol]int descriptor, int mode) { self.Mode = (IOMode)mode; self.SetStream(GetDescriptorStream(self.Context, descriptor)); self.SetFileDescriptor(descriptor); return self; }
public static RubyIO/*!*/ Reopen(RubyIO/*!*/ self, [DefaultProtocol, NotNull]MutableString/*!*/ path, int mode) { Stream newStream = RubyFile.OpenFileStream(self.Context, path.ConvertToString(), (IOMode)mode); self.Context.SetStream(self.GetFileDescriptor(), newStream); self.SetStream(newStream); self.Mode = (IOMode)mode; return self; }