ThrowIfClosed() private method

private ThrowIfClosed ( ) : void
return void
Ejemplo n.º 1
0
        public static MutableString /*!*/ Read(RubyDir /*!*/ self)
        {
            self.ThrowIfClosed();

            if (self._pos + 1 > self._rawEntries.Length)
            {
                return(null);
            }

            MutableString ret;

            if (self._pos == -2)
            {
                ret = MutableString.Create(".");
            }
            else if (self._pos == -1)
            {
                ret = MutableString.Create("..");
            }
            else
            {
                ret = MutableString.Create(Path.GetFileName(self._rawEntries[self._pos]));
            }
            self._pos++;
            return(ret);
        }
Ejemplo n.º 2
0
Archivo: Dir.cs Proyecto: ltwlf/IronSP
        public static MutableString Read(RubyContext /*!*/ context, RubyDir /*!*/ self)
        {
            self.ThrowIfClosed();

            if (self._pos + 1 > self._rawEntries.Length)
            {
                return(null);
            }

            MutableString ret;

            if (self._pos == -2)
            {
                ret = context.EncodePath(".");
            }
            else if (self._pos == -1)
            {
                ret = context.EncodePath("..");
            }
            else
            {
                ret = context.EncodePath(context.Platform.GetFileName(self._rawEntries[self._pos]));
            }
            self._pos++;
            return(ret);
        }
Ejemplo n.º 3
0
        public static RubyDir /*!*/ Each(BlockParam block, RubyDir /*!*/ self)
        {
            self.ThrowIfClosed();

            RubyDir.ForEach(block, self, self._dirName);
            return(self);
        }
Ejemplo n.º 4
0
Archivo: Dir.cs Proyecto: ltwlf/IronSP
        public static RubyDir /*!*/ Rewind(RubyDir /*!*/ self)
        {
            self.ThrowIfClosed();

            self._pos = -2;
            return(self);
        }
Ejemplo n.º 5
0
Archivo: Dir.cs Proyecto: ltwlf/IronSP
        public static int SetPosition(RubyDir /*!*/ self, int pos)
        {
            self.ThrowIfClosed();

            self._pos = pos - 2;
            return(pos);
        }
Ejemplo n.º 6
0
Archivo: Dir.cs Proyecto: ltwlf/IronSP
        public static MutableString GetPath(RubyContext /*!*/ context, RubyDir /*!*/ self)
        {
            if (context.RubyOptions.Compatibility < RubyCompatibility.Ruby19)
            {
                self.ThrowIfClosed();
            }
            else if (self.Closed)
            {
                return(null);
            }

            return(self._dirName.Clone());
        }
Ejemplo n.º 7
0
Archivo: Dir.cs Proyecto: ltwlf/IronSP
        public static RubyDir /*!*/ Seek(RubyDir /*!*/ self, int pos)
        {
            self.ThrowIfClosed();

            if (pos < 0)
            {
                self._pos = -2;
            }
            else if (pos > self._rawEntries.Length + 2)
            {
                self._pos = self._rawEntries.Length;
            }
            else
            {
                self._pos = pos - 2;
            }
            return(self);
        }
Ejemplo n.º 8
0
        public static int GetCurrentPosition(RubyDir/*!*/ self) {
            self.ThrowIfClosed();

            return self._pos + 2;
        }
Ejemplo n.º 9
0
        public static MutableString GetPath(RubyContext/*!*/ context, RubyDir/*!*/ self) {
            if (context.RubyOptions.Compatibility == RubyCompatibility.Ruby18) {
                self.ThrowIfClosed();
            } else if (self.Closed) {
                return null;
            }

            return self._dirName.Clone();
        }
Ejemplo n.º 10
0
 public static void Close(RubyDir/*!*/ self) {
     self.ThrowIfClosed();
     self.Close();
 }
Ejemplo n.º 11
0
        public static MutableString/*!*/ GetPath(RubyDir/*!*/ self) {
            self.ThrowIfClosed();

            return self._dirName;
        }
Ejemplo n.º 12
0
        public static RubyDir/*!*/ Each(BlockParam block, RubyDir/*!*/ self) {
            self.ThrowIfClosed();

            RubyDir.ForEach(block, self, self._dirName);
            return self;
        }
Ejemplo n.º 13
0
        public static MutableString/*!*/ Read(RubyDir/*!*/ self) {
            self.ThrowIfClosed();

            if (self._pos + 1 > self._rawEntries.Length) {
                return null;
            }

            MutableString ret;
            if (self._pos == -2) {
                ret = MutableString.CreateAscii(".");
            } else if (self._pos == -1) {
                ret = MutableString.CreateAscii("..");
            } else {
                ret = MutableString.Create(Path.GetFileName(self._rawEntries[self._pos]), RubyEncoding.Path);
            }
            self._pos++;
            return ret;
        }
Ejemplo n.º 14
0
        public static RubyDir/*!*/ Rewind(RubyDir/*!*/ self) {
            self.ThrowIfClosed();

            self._pos = -2;
            return self;
        }
Ejemplo n.º 15
0
        public static int SetPosition(RubyDir/*!*/ self, int pos) {
            self.ThrowIfClosed();

            self._pos = pos - 2;
            return pos;
        }
Ejemplo n.º 16
0
Archivo: Dir.cs Proyecto: ltwlf/IronSP
 public static void Close(RubyDir /*!*/ self)
 {
     self.ThrowIfClosed();
     self.Close();
 }
Ejemplo n.º 17
0
        public static void Close(RubyDir /*!*/ self)
        {
            self.ThrowIfClosed();

            self._closed = true;
        }
Ejemplo n.º 18
0
        public static MutableString /*!*/ GetPath(RubyDir /*!*/ self)
        {
            self.ThrowIfClosed();

            return(self._dirName);
        }
Ejemplo n.º 19
0
        public static MutableString Read(RubyContext/*!*/ context, RubyDir/*!*/ self) {
            self.ThrowIfClosed();

            if (self._pos + 1 > self._rawEntries.Length) {
                return null;
            }

            MutableString ret;
            if (self._pos == -2) {
                ret = context.EncodePath(".");
            } else if (self._pos == -1) {
                ret = context.EncodePath("..");
            } else {
                ret = context.EncodePath(context.Platform.GetFileName(self._rawEntries[self._pos]));
            }
            self._pos++;
            return ret;
        }
Ejemplo n.º 20
0
Archivo: Dir.cs Proyecto: ltwlf/IronSP
        public static int GetCurrentPosition(RubyDir /*!*/ self)
        {
            self.ThrowIfClosed();

            return(self._pos + 2);
        }
Ejemplo n.º 21
0
        public static RubyDir/*!*/ Seek(RubyDir/*!*/ self, int pos) {
            self.ThrowIfClosed();

            if (pos < 0) {
                self._pos = -2;
            } else if (pos > self._rawEntries.Length + 2) {
                self._pos = self._rawEntries.Length;
            } else {
                self._pos = pos - 2;
            }
            return self;
        }
Ejemplo n.º 22
0
        public static void Close(RubyDir/*!*/ self) {
            self.ThrowIfClosed();

            self._closed = true;
        }