Inheritance: IPersistedLob
Exemplo n.º 1
0
 public override bool Equals(Clob clob)
 {
     if (clob == this) return true;
     var sc = clob as StringClob;
     if (sc == null) return false;
     return _text.Equals(sc._text);
 }
Exemplo n.º 2
0
 public override bool Equals(Clob clob)
 {
     var rc = clob as TextReaderClob;
     if (rc == null) return false;
     if (rc == this) return true;
     return _reader == rc._reader;
 }
Exemplo n.º 3
0
 public override bool Equals(Clob clob)
 {
     var fc = clob as FileClob;
     if (fc == null) return false;
     if (fc == this) return true;
     return fc._filename.Equals(_filename) && (fc._encoding == null || _encoding == null || fc._encoding == _encoding);
 }
Exemplo n.º 4
0
        public override bool Equals(Clob clob)
        {
            if (clob == null)
            {
                return(false);
            }
            if (clob == this)
            {
                return(true);
            }
            var wb = clob as WebClob;

            if (wb != null)
            {
                return(_uri.Equals(wb._uri) && _credentials == wb._credentials && _headers == wb._headers);
            }
            if (!_uri.IsFile)
            {
                return(false);
            }
            var fb = clob as FileClob;

            if (fb == null)
            {
                return(false);
            }
            return(_uri.LocalPath.Equals(fb.Filename));
        }
Exemplo n.º 5
0
 public override bool Equals(Clob clob)
 {
     var ec = clob as EmptyClob;
     if (ec != null) return true;
     var sc = clob as StringClob;
     if (sc != null && sc.Text == "") return true;
     return false;
 }
Exemplo n.º 6
0
 public override bool Equals(Clob clob)
 {
     if (clob == null) return false;
     if (clob == this) return true;
     var ec = clob as ExternalClob;
     if (ec == null || !Connection.Equals(ec.Connection) || _identifier.Length != ec._identifier.Length ||
         !_encoding.Equals(ec._encoding) ||
         (_compression != ec._compression && _compression != null && !_compression.Equals(ec._compression))) return false;
     byte[] a = _identifier, b = ec._identifier;
     return !a.Where((t, i) => t != b[i]).Any();
 }
Exemplo n.º 7
0
        public override bool Equals(Clob clob)
        {
            var rc = clob as TextReaderClob;

            if (rc == null)
            {
                return(false);
            }
            if (rc == this)
            {
                return(true);
            }
            return(_reader == rc._reader);
        }
Exemplo n.º 8
0
        public override bool Equals(Clob clob)
        {
            var fc = clob as FileClob;

            if (fc == null)
            {
                return(false);
            }
            if (fc == this)
            {
                return(true);
            }
            return(fc._filename.Equals(_filename) && (fc._encoding == null || _encoding == null || fc._encoding == _encoding));
        }
Exemplo n.º 9
0
        public override bool Equals(Clob clob)
        {
            if (clob == this)
            {
                return(true);
            }
            var sc = clob as StringClob;

            if (sc == null)
            {
                return(false);
            }
            return(_text.Equals(sc._text));
        }
Exemplo n.º 10
0
        public override bool Equals(Clob clob)
        {
            var ec = clob as EmptyClob;

            if (ec != null)
            {
                return(true);
            }
            var sc = clob as StringClob;

            if (sc != null && sc.Text == "")
            {
                return(true);
            }
            return(false);
        }
Exemplo n.º 11
0
        public static long GetLength(this Clob clob)
        {
            using (TextReader reader = clob.OpenReader())
            {
                var buffer = new char[1024];

                long count = 0;

                while (true)
                {
                    int length = reader.ReadBlock(buffer, 0, buffer.Length);
                    if (length > 0)
                    {
                        count += length;
                    }
                    else
                    {
                        break;
                    }
                }

                return(count);
            }
        }
Exemplo n.º 12
0
 public abstract bool Equals(Clob clob);
Exemplo n.º 13
0
 public abstract bool Equals(Clob clob);
Exemplo n.º 14
0
 public override bool Equals(Clob clob)
 {
     if (clob == null) return false;
     if (clob == this) return true;
     var wb = clob as WebClob;
     if (wb != null) return _uri.Equals(wb._uri) && _credentials == wb._credentials && _headers == wb._headers;
     if (!_uri.IsFile) return false;
     var fb = clob as FileClob;
     if (fb == null) return false;
     return _uri.LocalPath.Equals(fb.Filename);
 }