Inheritance: IPersistedLob
Beispiel #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);
 }
Beispiel #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;
 }
Beispiel #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);
 }
Beispiel #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));
        }
Beispiel #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;
 }
Beispiel #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();
 }
        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);
        }
Beispiel #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));
        }
Beispiel #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));
        }
Beispiel #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);
        }
Beispiel #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);
            }
        }
Beispiel #12
0
 public abstract bool Equals(Clob clob);
Beispiel #13
0
 public abstract bool Equals(Clob clob);
Beispiel #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);
 }