DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Public Member Functions | Package Functions | Static Package Functions | Properties | List of all members
Deveel.Data.Sql.IndexInfo Class Reference

Public Member Functions

 IndexInfo (string indexName, string indexType, string[] columnNames)
 
 IndexInfo (string indexName, string indexType, string[] columnNames, bool isUnique, int offset)
 
 IndexInfo (string indexName, string indexType, string[] columnNames, bool isUnique)
 

Package Functions

void SerializeTo (Stream stream)
 

Static Package Functions

static IndexInfo DeserializeFrom (Stream stream)
 

Properties

string IndexName [get, private set]
 
string IndexType [get, private set]
 
string[] ColumnNames [get, private set]
 
bool IsUnique [get, private set]
 
int Offset [get, set]
 

Detailed Description

Definition at line 22 of file IndexInfo.cs.

Constructor & Destructor Documentation

Deveel.Data.Sql.IndexInfo.IndexInfo ( string  indexName,
string  indexType,
string[]  columnNames 
)
inline

Definition at line 23 of file IndexInfo.cs.

24  : this(indexName, indexType, columnNames, false) {
25  }
Deveel.Data.Sql.IndexInfo.IndexInfo ( string  indexName,
string  indexType,
string[]  columnNames,
bool  isUnique,
int  offset 
)
inline

Definition at line 27 of file IndexInfo.cs.

27  {
28  if (String.IsNullOrEmpty(indexType))
29  throw new ArgumentNullException("indexType");
30  if (String.IsNullOrEmpty(indexName))
31  throw new ArgumentNullException("indexName");
32  if (columnNames == null || columnNames.Length == 0)
33  throw new ArgumentNullException("columnNames");
34 
35  IndexName = indexName;
36  IndexType = indexType;
37  ColumnNames = columnNames;
38  IsUnique = isUnique;
39  Offset = offset;
40  }
A long string in the system.
Deveel.Data.Sql.IndexInfo.IndexInfo ( string  indexName,
string  indexType,
string[]  columnNames,
bool  isUnique 
)
inline

Definition at line 42 of file IndexInfo.cs.

43  : this(indexName, indexType, columnNames, isUnique, -1) {
44  }

Member Function Documentation

static IndexInfo Deveel.Data.Sql.IndexInfo.DeserializeFrom ( Stream  stream)
inlinestaticpackage

Definition at line 72 of file IndexInfo.cs.

72  {
73  var reader = new BinaryReader(stream, Encoding.Unicode);
74 
75  var version = reader.ReadInt32();
76  if (version != 2)
77  throw new FormatException("Invalid version number for Index-Info");
78 
79  var indexType = reader.ReadString();
80  var indexName = reader.ReadString();
81  var unique = reader.ReadByte() == 1;
82  var offset = reader.ReadInt32();
83 
84  var colCount = reader.ReadInt32();
85 
86  var columnNames = new string[colCount];
87  for (int i = 0; i < colCount; i++) {
88  var columnName = reader.ReadString();
89  columnNames[i] = columnName;
90  }
91 
92  return new IndexInfo(indexName, indexType, columnNames, unique, offset);
93  }
IndexInfo(string indexName, string indexType, string[] columnNames)
Definition: IndexInfo.cs:23
void Deveel.Data.Sql.IndexInfo.SerializeTo ( Stream  stream)
inlinepackage

Definition at line 56 of file IndexInfo.cs.

56  {
57  var writer = new BinaryWriter(stream, Encoding.Unicode);
58  writer.Write(2); // Version
59  writer.Write(IndexType);
60  writer.Write(IndexName);
61  writer.Write(IsUnique ? (byte) 1 : (byte) 0);
62  writer.Write(Offset);
63 
64  var colCount = ColumnNames.Length;
65  writer.Write(colCount);
66  for (int i = 0; i < colCount; i++) {
67  var colName = ColumnNames[i];
68  writer.Write(colName);
69  }
70  }

Property Documentation

string [] Deveel.Data.Sql.IndexInfo.ColumnNames
getprivate set

Definition at line 50 of file IndexInfo.cs.

string Deveel.Data.Sql.IndexInfo.IndexName
getprivate set

Definition at line 46 of file IndexInfo.cs.

string Deveel.Data.Sql.IndexInfo.IndexType
getprivate set

Definition at line 48 of file IndexInfo.cs.

bool Deveel.Data.Sql.IndexInfo.IsUnique
getprivate set

Definition at line 52 of file IndexInfo.cs.

int Deveel.Data.Sql.IndexInfo.Offset
getset

Definition at line 54 of file IndexInfo.cs.


The documentation for this class was generated from the following file: