1 /***************************************************************************
3 * Copyright (C) Lakshya Solutions Ltd. All rights reserved. *
5 ***************************************************************************/
13 //used by FieldNameList
17 char fldName
[IDENTIFIER_LENGTH
];
38 isAutoIncrement_
=false;
41 char fldName_
[IDENTIFIER_LENGTH
];
45 //currently default value is supported for string and binary
46 //less than length 32 bytes
47 char defaultValueBuf_
[DEFAULT_VALUE_BUF_LENGTH
];
49 //used only in case of binding fields
56 bool isAutoIncrement_
;
57 long long autoVal_
;//[DEFAULT_VALUE_BUF_LENGTH];
58 //TODO::width and scale
73 FieldIterator(FieldNode
*ptr
) { iter
= ptr
; }
76 if (iter
== NULL
) return false; else return true;
78 FieldDef
* nextElement()
80 if (iter
== NULL
) { return NULL
;}
81 FieldNode
*node
= iter
;
83 return &(node
->fldDef
);
89 //Internal class used to implement the field list information
95 FieldList(){ head
= NULL
;}
97 //TODO::pass by reference instead of value
98 DbRetVal
append(FieldDef fDef
);
100 DbRetVal
remove(const char* fldName
);
102 DbRetVal
removeAll();
104 DbRetVal
updateBindVal(const char *fldName
, void *val
);
105 void * getBindField(const char *fldName
);
106 int getFieldOffset(const char *fldName
);
107 int getFieldOffset(int fldpos
);
109 //Returns position of field in the list:count starting from 1
110 int getFieldPosition(const char *fldName
);
112 DataType
getFieldType(const char *fldName
);
114 size_t getFieldLength(const char *fldName
);
116 DbRetVal
getFieldInfo(const char *fldName
, FieldInfo
*&info
);
117 void fillFieldInfo(int fldpos
, void *info
);
121 FieldIterator
getIterator()
123 FieldIterator
iter(head
);
128 //The below struct should be same as Parser.h:FieldValue
129 //For performance reason and it is
130 //done such that storage does not have dependency on SQL
131 struct FieldInfoValue
133 char fldName
[IDENTIFIER_LENGTH
];
136 int paramNo
; // 0 ->not a param. It stores the param position
138 int aType
; //assumes enum is always int
147 bool isAutoIncrement
;