Пример #1
0
        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));
        }
Пример #2
0
        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);
        }