00001
00002
00003
00004
00005
00006
00007 #ifndef __UNICONFINI_H
00008 #define __UNICONFINI_H
00009
00010 #include "unitempgen.h"
00011 #include "wvlog.h"
00012 #include <sys/stat.h>
00013
00014 class WvFile;
00015
00025 class UniIniGen : public UniTempGen
00026 {
00027 WvString filename;
00028 int create_mode;
00029 WvLog log;
00030 struct stat old_st;
00031
00032 public:
00037 UniIniGen(WvStringParm filename, int _create_mode = 0666);
00038
00039 virtual ~UniIniGen();
00040
00041
00042
00043 virtual void commit();
00044 virtual bool refresh();
00045 virtual void set(const UniConfKey &key, WvStringParm value);
00046
00047 private:
00048 #ifndef _WIN32
00049
00050 bool commit_atomic(WvStringParm real_filename);
00051 #endif
00052
00053 void save(WvStream &file, UniConfValueTree &parent);
00054 bool refreshcomparator(const UniConfValueTree *a,
00055 const UniConfValueTree *b, void *userdata);
00056 };
00057
00058
00059 #endif // __UNICONFINI_H