1 /***************************************************************************
2 * Copyright (C) 2007 by www.databasecache.com *
3 * Contact: praba_tuty@databasecache.com *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 ***************************************************************************/
22 //used by FieldNameList
26 char fldName
[IDENTIFIER_LENGTH
];
45 char fldName_
[IDENTIFIER_LENGTH
];
48 //currently default value is supported for string and binary
49 //less than length 32 bytes
50 char defaultValueBuf_
[DEFAULT_VALUE_BUF_LENGTH
];
52 //used only in case of binding fields
59 //TODO::width and scale
74 FieldIterator(FieldNode
*ptr
) { iter
= ptr
; }
77 if (iter
== NULL
) return false; else return true;
79 FieldDef
nextElement()
81 if (iter
== NULL
) { FieldDef dummyDef
; return dummyDef
;}
82 FieldNode
*node
= iter
;
90 //Internal class used to implement the field list information
96 FieldList(){ head
= NULL
;}
98 //TODO::pass by reference instead of value
99 DbRetVal
append(FieldDef fDef
);
101 DbRetVal
remove(const char* fldName
);
103 DbRetVal
removeAll();
105 DbRetVal
updateBindVal(const char *fldName
, void *val
);
107 int getFieldOffset(const char *fldName
);
108 int getFieldOffset(int fldpos
);
110 DataType
getFieldType(const char *fldName
);
112 size_t getFieldLength(const char *fldName
);
114 DbRetVal
getFieldInfo(const char *fldName
, FieldInfo
*&info
);
118 FieldIterator
getIterator()
120 FieldIterator
iter(head
);