COOPY » Guide
version 0.6.5
|
00001 #ifndef COOPY_WIDESHEETMANAGER 00002 #define COOPY_WIDESHEETMANAGER 00003 00004 #include <string> 00005 #include <vector> 00006 00007 class sqlite3; 00008 00009 class WideSheetManager { 00010 private: 00011 sqlite3 *db; 00012 std::string dir; 00013 std::string sep; 00014 00015 public: 00016 WideSheetManager() { 00017 db = 0/*NULL*/; 00018 } 00019 00020 00021 WideSheetManager(bool create, const char *fname = NULL) { 00022 db = 0/*NULL*/; 00023 connect(create,fname); 00024 } 00025 00026 ~WideSheetManager(); 00027 00028 bool connect(bool create = false, const char *fname = NULL); 00029 bool disconnect(); 00030 00031 bool isValid() { 00032 return db!=0/*NULL*/; 00033 } 00034 00035 bool setProperty(const char *key, const char *val); 00036 00037 std::string getProperty(const char *key); 00038 00039 std::string getPropertyWithDefault(const char *key); 00040 00041 bool exportSheet(); 00042 00043 bool acceptSheet(); 00044 00045 bool diffSheet(); 00046 00047 sqlite3 *get() { 00048 return db; 00049 } 00050 00051 std::string linkTable() { 00052 return "widesheet_links"; 00053 } 00054 00055 bool setFile(const char *key, const char *val); 00056 00057 std::string getFile(const char *key); 00058 00059 bool exportSheet(const char *key, bool reverse = false); 00060 00061 bool importSheet(const char *key) { 00062 return exportSheet(key, true); 00063 } 00064 00065 bool setDirectory(const char *dir, const char *sep = "/"); 00066 00067 bool mergeToLocal(const char *local, 00068 const char *remote, 00069 const char *pivot, 00070 const char *log); 00071 00072 }; 00073 00074 #endif