19 using System.Collections.Generic;
25 namespace Deveel.Data.Sql.Objects {
32 if (!isNull && largeObject == null)
33 throw new ArgumentNullException(
"largeObject");
35 this.largeObject = largeObject;
45 : this(largeObject, encoding, false) {
52 public Encoding Encoding {
get;
private set; }
56 GC.SuppressFinalize(
this);
61 if (largeObject != null)
62 largeObject.Dispose();
69 int IComparable.CompareTo(
object obj) {
70 throw new NotSupportedException();
73 int IComparable<ISqlObject>.CompareTo(
ISqlObject other) {
74 throw new NotSupportedException();
78 get {
return largeObject.
Id; }
81 public bool IsNull {
get;
private set; }
87 public char this[
long offset] {
90 throw new ArgumentOutOfRangeException(
"offset");
91 if (largeObject == null)
94 throw new NotImplementedException();
98 int IComparable<ISqlString>.CompareTo(
ISqlString other) {
99 throw new NotSupportedException();
106 IEnumerator IEnumerable.GetEnumerator() {
107 return GetEnumerator();
110 public long Length {
get;
private set; }
113 if (largeObject == null)
114 return TextReader.Null;
116 return new StreamReader(
new ObjectStream(largeObject), encoding);
137 this.longString = longString;
142 if (reader != null) {
149 curChar = reader.Read();
150 return curChar != -1;
154 reader = longString.GetInput(longString.Encoding);
157 public char Current {
160 throw new EndOfStreamException();
162 return (
char) curChar;
166 object IEnumerator.Current {
167 get {
return Current; }
Defines a referenced object that can be accessed on a multi-phase level.
static SqlLongString Unicode(ILargeObject largeObject)
TextReader GetInput(Encoding encoding)
long RawSize
Gets the raw byte size of the object.
static SqlLongString Ascii(ILargeObject largeObject)
IEnumerator< char > GetEnumerator()
SqlLongString(ILargeObject largeObject, Encoding encoding)
Defines the contract for a valid SQL Object
A unique identifier of an object within a database system, that is composed by a reference to the sto...
bool IsComparableTo(ISqlObject other)
Checks if the current object is comparable with the given one.
void Dispose(bool disposing)
ObjectId Id
Gets the unique identifier of the object within the system.
SqlLongString(ILargeObject largeObject, Encoding encoding, bool isNull)
readonly SqlLongString longString
Enumerator(SqlLongString longString)