notepad_filestore.h
Go to the documentation of this file.00001 #ifndef __NOTEPAD_FILESTORE_H__
00002 #define __NOTEPAD_FILESTORE_H__
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #include <libermetadb/ermetadb.h>
00033
00034
00035 namespace notepad
00036 {
00037
00038
00039
00040
00041 class CFileStore
00042 {
00043 public:
00044 CFileStore ();
00045 virtual ~CFileStore ();
00046 private:
00047 CFileStore(const CFileStore&);
00048 CFileStore operator=(const CFileStore&);
00049 private:
00050 np_result openDatabase(const gchar* folder, const gchar* filename);
00051 void closeDatabase(void);
00052 np_result createDatabase(const gchar* folder, const gchar* file, const char* title);
00053 np_result renameDatabase(const gchar* srcdir, const gchar* srcfile, const gchar* destfile);
00054 public:
00055 np_result createFile(const gchar* filename);
00056 np_result openFile(const gchar* filename);
00057 void closeFile();
00058 np_result renameFile(const gchar* newfilename);
00059 gchar* getFilename(void);
00060 erMetadb getFile(void);
00061 public:
00062 gchar* getFileNameDirPart(void);
00063 gchar* getFileNameFilePart(void);
00064 gchar* getFileNameFilePartNoExt(void);
00065 private:
00066 gchar* generateNewFilename(void);
00067 gchar* noExt(const char* filename);
00068 private:
00069
00070 gboolean load_string(const char *key, gchar** value);
00071 gboolean save_string(const char *key, const gchar* value);
00072 public:
00073 gint get_last_read_location(void);
00074 gboolean set_last_read_location(gint location);
00075
00076 private:
00077 erMetadb m_db;
00078 gchar* m_dbfilename;
00079 };
00080 }
00081
00082
00083 #endif // __NOTEPAD_FILESTORE_H__