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 ***************************************************************************/
23 char tableName
[IDENTIFIER_LENGTH
];
24 char fieldName
[IDENTIFIER_LENGTH
];
25 char userName
[IDENTIFIER_LENGTH
];
26 char password
[IDENTIFIER_LENGTH
];
27 char conditionVal
[IDENTIFIER_LENGTH
]; //added newly
28 char fieldlistVal
[IDENTIFIER_LENGTH
];
34 strcpy(conditionVal
,"");
36 strcpy(fieldlistVal
,"");
39 void setForceFlag(bool flag
){ shouldForce
= flag
;}
40 void setConnParam(char *user
, char *pass
){ strcpy(userName
, user
); strcpy(password
, pass
); }
41 void setTable(char *tablename
) { strcpy(tableName
,tablename
); }
42 void setCondition(char *condition
){strcpy(conditionVal
,condition
);} //new one
43 void setFieldName(char *fldname
){ strcpy(fieldName
,fldname
);}
44 DbRetVal
addToCacheTableFile(bool isDirect
);
45 static int getTableMode(char *tabname
);
46 void setFieldListVal(char *field
) {strcpy(fieldlistVal
,field
);}
48 DbRetVal
addToCacheTableFile();
49 DbRetVal
removeFromCacheTableFile();
50 // DbRetVal load(bool tabDef=true);
52 // DbRetVal unload(bool tabDefinition = true);
53 // DbRetVal refresh();
54 // DbRetVal recoverAllCachedTables();
55 // DbRetVal load(DatabaseManager *dbMgr, bool tabDef);
56 static DbRetVal
isTableCached(char *tablename
);
57 DbRetVal
isTablePresent();// new one by :Jitendra
58 bool isFieldExist(char *fieldname
);
59 DbRetVal
CacheInfo(bool isTabPresent
);
60 char *getRealConditionFromFile(char *condition
);
61 char *getConditionVal(char *condition
);
67 static TableConfig config
;
82 char tableName[IDENTIFIER_LENGTH];
83 char fieldName[IDENTIFIER_LENGTH];
84 char projFieldlist[IDENTIFIER_LENGTH];
85 char condition[IDENTIFIER_LENGTH];
87 void setTableName(char *tblName){strcpy(tableName,tblName);}
88 void setFieldName(char *fldName){strcpy(fieldName,fldName);}
89 void setProjFieldList(char *fieldlist){ strcpy(projFieldlist,fieldlist);}
90 void setCondition(char *cond){ strcpy(condition,cond);}
91 char *getTableName(){return tableName;}
92 char *getFieldName(){return fieldName;}
93 char *getCondition(){ return condition;}
94 char *getProjFieldList(){return projFieldlist;}