public static StringIO /*!*/ Create(RubyClass /*!*/ self, [DefaultProtocol, NotNull] MutableString /*!*/ initialString, [DefaultProtocol, Optional, NotNull] MutableString mode) { IOMode ioMode = IOModeEnum.Parse(mode, initialString.IsFrozen ? IOMode.ReadOnly : IOMode.ReadWrite) | IOMode.PreserveEndOfLines; return(new StringIO(CheckContent(initialString, ioMode), ioMode)); }
public static StringIO /*!*/ Reopen(StringIO /*!*/ self, [DefaultProtocol, NotNull] MutableString /*!*/ content, [DefaultProtocol, NotNull] MutableString mode) { IOMode ioMode = IOModeEnum.Parse(mode, content.IsFrozen ? IOMode.ReadOnly : IOMode.ReadWrite) | IOMode.PreserveEndOfLines; self.SetContent(CheckContent(content, ioMode)); self._mode = ioMode; return(self); }