uniinigen.h

00001 /* -*- Mode: C++ -*-
00002  * Worldvisions Weaver Software:
00003  *   Copyright (C) 1997-2002 Net Integration Technologies, Inc.
00004  * 
00005  * A generator for .ini files.
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     /***** Overridden members *****/
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     // helper methods for commit
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

Generated on Sun Sep 24 20:10:48 2006 for WvStreams by  doxygen 1.4.7