Allow schema files that are missing checksums on the !!SCHEMAMATIC line.
[versaplex.git] / versaplexd / vxcolumninfo.cs
blob6a9404ead03d3546bfa1d4825f6e20ab5ab7dee8
1 /*
2 * Versaplex:
3 * Copyright (C)2007-2008 Versabanq Innovations Inc. and contributors.
4 * See the included file named LICENSE for license information.
5 */
6 using System;
7 using Wv;
9 public struct VxColumnInfo {
10 internal int size;
11 internal string colname;
12 internal VxColumnType coltype;
13 internal short precision;
14 internal short scale;
15 internal byte nullable;
17 public string ColumnName {
18 get { return colname; }
19 set { colname = value; }
22 public VxColumnType VxColumnType {
23 get { return coltype; }
24 set { coltype = value; }
27 public string ColumnType {
28 get { return coltype.ToString(); }
31 public bool Nullable {
32 get { return (nullable != 0); }
33 set { nullable = value ? (byte)1 : (byte)0; }
36 public int Size {
37 get { return size; }
38 set {
39 if (value < 0)
40 throw new ArgumentOutOfRangeException(
41 "Size must be nonnegative");
43 size = value;
47 public short Precision {
48 get { return precision; }
49 set {
50 if (value < 0)
51 throw new ArgumentOutOfRangeException(
52 "Precision must be nonnegative");
54 precision = value;
58 public short Scale {
59 get { return scale; }
60 set {
61 if (value < 0)
62 throw new ArgumentOutOfRangeException(
63 "Scale must be nonnegative");
65 scale = value;
69 public VxColumnInfo(string colname, VxColumnType vxcoltype, bool nullable,
70 int size, short precision, short scale)
72 ColumnName = colname;
73 VxColumnType = vxcoltype;
74 Nullable = nullable;
75 Size = size;
76 Precision = precision;
77 Scale = scale;
81 public enum VxColumnType {
82 Int64,
83 Int32,
84 Int16,
85 UInt8,
86 Bool,
87 Double,
88 Uuid,
89 Binary,
90 String,
91 DateTime,
92 Decimal