Пример #1
0
        public static StringIO /*!*/ Reopen(StringIO /*!*/ self, [DefaultProtocol, NotNull] MutableString /*!*/ content, int mode)
        {
            IOMode ioMode = (IOMode)mode | IOMode.PreserveEndOfLines;

            self.SetContent(CheckContent(content, ioMode));
            self._mode = ioMode;
            return(self);
        }
Пример #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);
        }
Пример #3
0
        public static StringIO /*!*/ Reopen(RubyContext /*!*/ context, [NotNull] StringIO /*!*/ self, [NotNull] StringIO /*!*/ other)
        {
            self.SetContent(other._content);
            self._mode       = other._mode;
            self._lineNumber = other._lineNumber;
            self._position   = other._position;

            // TODO: this seems to be MRI bug
            // Shouldn't StringIO's taint be always same as the underlying string's taint?
            context.TaintObjectBy(self, other);
            return(self);
        }
Пример #4
0
 public static MutableString /*!*/ SetString(StringIO /*!*/ self, [DefaultProtocol, NotNull] MutableString /*!*/ str)
 {
     self.SetContent(str);
     return(str);
 }
Пример #5
0
 public static StringIO /*!*/ Reopen(StringIO /*!*/ self)
 {
     self.SetContent(MutableString.CreateBinary());
     self._mode = IOMode.ReadWrite;
     return(self);
 }
Пример #6
0
 public static MutableString/*!*/ SetString(StringIO/*!*/ self, [DefaultProtocol, NotNull]MutableString/*!*/ str) {
     self.SetContent(str);
     return str;
 }
Пример #7
0
 public static StringIO/*!*/ Reopen(StringIO/*!*/ self, [DefaultProtocol, NotNull]MutableString/*!*/ content, int mode) {
     IOMode ioMode = (IOMode)mode | IOMode.PreserveEndOfLines;
     self.SetContent(CheckContent(content, ioMode));
     self._mode = ioMode;
     return self;
 }
Пример #8
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;
 }
Пример #9
0
 public static StringIO/*!*/ Reopen(StringIO/*!*/ self) {
     self.SetContent(MutableString.CreateBinary());
     self._mode = IOMode.ReadWrite;
     return self;
 }