Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

WvConf Class Reference

#include <wvconf.h>

Inherits WvConfigSectionList.

Collaboration diagram for WvConf:

[legend]
List of all members.

Detailed Description

WvConf configuration file management class: used to read/write config files that are formatted in the style of Windows .ini files.

Definition at line 104 of file wvconf.h.

Public Member Functions

 WvConf (WvStringParm _filename, int _create_mode=0666)
 ~WvConf ()
bool isok () const
bool isclean () const
void save (WvStringParm filename)
void save ()
void flush ()
WvConfigSectionoperator[] (WvStringParm s)
int parse_wvconf_request (char *request, char *&section, char *&entry, char *&value)
int getint (WvStringParm section, WvStringParm entry, int def_val)
const char * get (WvStringParm section, WvStringParm entry, const char *def_val=NULL)
WvString getraw (WvString wvconfstr, int &parse_error)
int fuzzy_getint (WvStringList &sect, WvStringParm entry, int def_val)
const char * fuzzy_get (WvStringList &sect, WvStringParm entry, const char *def_val=NULL)
int fuzzy_getint (WvStringList &sect, WvStringList &entry, int def_val)
const char * fuzzy_get (WvStringList &sect, WvStringList &ent, const char *def_val=NULL)
void setint (WvStringParm section, WvStringParm entry, int value)
void set (WvStringParm section, WvStringParm entry, const char *value)
void setraw (WvString wvconfstr, const char *&value, int &parse_error)
void maybesetint (WvStringParm section, WvStringParm entry, int value)
void maybeset (WvStringParm section, WvStringParm entry, const char *value)
void delete_section (WvStringParm section)
void add_callback (WvConfCallback callback, void *userdata, WvStringParm section, WvStringParm entry, void *cookie)
void del_callback (WvStringParm section, WvStringParm entry, void *cookie)
void run_callbacks (WvStringParm section, WvStringParm entry, WvStringParm oldvalue, WvStringParm newvalue)
void run_all_callbacks ()
void setbool (void *userdata, WvStringParm section, WvStringParm entry, WvStringParm oldval, WvStringParm newval)
void addname (void *userdata, WvStringParm section, WvStringParm entry, WvStringParm oldval, WvStringParm newval)
void addfile (void *userdata, WvStringParm section, WvStringParm entry, WvStringParm oldval, WvStringParm newval)
void add_addfile (WvString *filename, WvStringParm sect, WvStringParm ent)
void add_addname (WvStringList *list, WvStringParm sect, WvStringParm ent)
void del_addname (WvStringList *list, WvStringParm sect, WvStringParm ent)
void add_setbool (bool *b, WvStringParm section, WvStringParm entry)
void del_setbool (bool *b, WvStringParm section, WvStringParm entry)
void load_file ()
void load_file (WvStringParm filename)
WvString get_passwd (WvStringParm sect, WvStringParm user)
WvString get_passwd (WvStringParm user)
WvString get_passwd2 (WvString pwenc)
bool check_passwd (WvStringParm sect, WvStringParm user, WvStringParm passwd)
bool check_passwd (WvStringParm user, WvStringParm passwd)
bool user_exists (WvStringParm sect, WvStringParm user)
bool user_exists (WvStringParm user)
void set_passwd (WvStringParm sect, WvStringParm user, WvStringParm passwd)
void set_passwd (WvStringParm user, WvStringParm passwd)
WvString set_passwd2 (WvStringParm passwd)
void convert_to_old_pw ()
void setdirty ()

Static Public Member Functions

int check_for_bool_string (const char *s)


Constructor & Destructor Documentation

WvConf::WvConf WvStringParm  _filename,
int  _create_mode = 0666
 

Definition at line 56 of file wvconf.cc.

References load_file(), and log.

WvConf::~WvConf  ) 
 

Definition at line 261 of file wvconf.cc.

References flush().


Member Function Documentation

void WvConf::add_addfile WvString filename,
WvStringParm  sect,
WvStringParm  ent
[inline]
 

Definition at line 178 of file wvconf.h.

References add_addfile(), addfile(), and WvConfCallback.

Referenced by add_addfile().

void WvConf::add_addname WvStringList list,
WvStringParm  sect,
WvStringParm  ent
[inline]
 

Definition at line 182 of file wvconf.h.

References add_addname(), addname(), and WvConfCallback.

Referenced by add_addname().

void WvConf::add_callback WvConfCallback  callback,
void *  userdata,
WvStringParm  section,
WvStringParm  entry,
void *  cookie
 

Definition at line 539 of file wvconf.cc.

References add_callback(), and WvConfCallback.

Referenced by add_callback(), and UniWvConfGen::UniWvConfGen().

void WvConf::add_setbool bool *  b,
WvStringParm  section,
WvStringParm  entry
[inline]
 

Definition at line 188 of file wvconf.h.

References add_setbool(), setbool(), and WvConfCallback.

Referenced by add_setbool().

void WvConf::addfile void *  userdata,
WvStringParm  section,
WvStringParm  entry,
WvStringParm  oldval,
WvStringParm  newval
 

Definition at line 41 of file wvconf.cc.

References addfile(), WvFDStream::isok(), and WvStream::print().

Referenced by add_addfile(), and addfile().

void WvConf::addname void *  userdata,
WvStringParm  section,
WvStringParm  entry,
WvStringParm  oldval,
WvStringParm  newval
 

Definition at line 33 of file wvconf.cc.

References addname().

Referenced by add_addname(), and addname().

int WvConf::check_for_bool_string const char *  s  )  [static]
 

Definition at line 66 of file wvconf.cc.

References check_for_bool_string().

Referenced by check_for_bool_string(), fuzzy_getint(), and getint().

bool WvConf::check_passwd WvStringParm  user,
WvStringParm  passwd
[inline]
 

Definition at line 209 of file wvconf.h.

bool WvConf::check_passwd WvStringParm  sect,
WvStringParm  user,
WvStringParm  passwd
 

void WvConf::convert_to_old_pw  ) 
 

void WvConf::del_addname WvStringList list,
WvStringParm  sect,
WvStringParm  ent
[inline]
 

Definition at line 185 of file wvconf.h.

References del_addname().

Referenced by del_addname().

void WvConf::del_callback WvStringParm  section,
WvStringParm  entry,
void *  cookie
 

Definition at line 548 of file wvconf.cc.

References del_callback().

Referenced by del_callback().

void WvConf::del_setbool bool *  b,
WvStringParm  section,
WvStringParm  entry
[inline]
 

Definition at line 191 of file wvconf.h.

References del_setbool().

Referenced by del_setbool().

void WvConf::delete_section WvStringParm  section  ) 
 

Definition at line 428 of file wvconf.cc.

References delete_section().

Referenced by delete_section().

void WvConf::flush  ) 
 

Definition at line 527 of file wvconf.cc.

References save().

Referenced by ~WvConf().

const char * WvConf::fuzzy_get WvStringList sect,
WvStringList ent,
const char *  def_val = NULL
 

Definition at line 305 of file wvconf.cc.

References fuzzy_get(), and WvConfigSection::name.

const char * WvConf::fuzzy_get WvStringList sect,
WvStringParm  entry,
const char *  def_val = NULL
 

Definition at line 331 of file wvconf.cc.

References fuzzy_get(), and WvConfigSection::name.

Referenced by fuzzy_get(), and fuzzy_getint().

int WvConf::fuzzy_getint WvStringList sect,
WvStringList entry,
int  def_val
 

Definition at line 143 of file wvconf.cc.

References check_for_bool_string(), fuzzy_get(), and fuzzy_getint().

int WvConf::fuzzy_getint WvStringList sect,
WvStringParm  entry,
int  def_val
 

Definition at line 153 of file wvconf.cc.

References check_for_bool_string(), fuzzy_get(), and fuzzy_getint().

Referenced by fuzzy_getint().

const char * WvConf::get WvStringParm  section,
WvStringParm  entry,
const char *  def_val = NULL
 

Definition at line 270 of file wvconf.cc.

References WvConfigSection::get(), get(), and WvConfigSection::name.

Referenced by get(), UniWvConfGen::get(), getint(), getraw(), maybeset(), maybesetint(), and setraw().

WvString WvConf::get_passwd WvStringParm  user  )  [inline]
 

Definition at line 200 of file wvconf.h.

WvString WvConf::get_passwd WvStringParm  sect,
WvStringParm  user
 

WvString WvConf::get_passwd2 WvString  pwenc  ) 
 

int WvConf::getint WvStringParm  section,
WvStringParm  entry,
int  def_val
 

Definition at line 134 of file wvconf.cc.

References check_for_bool_string(), get(), and getint().

Referenced by getint().

WvString WvConf::getraw WvString  wvconfstr,
int &  parse_error
 

Definition at line 292 of file wvconf.cc.

References WvString::edit(), get(), getraw(), and parse_wvconf_request().

Referenced by getraw().

bool WvConf::isclean  )  const [inline]
 

Definition at line 112 of file wvconf.h.

References isok().

bool WvConf::isok  )  const [inline]
 

Definition at line 110 of file wvconf.h.

Referenced by isclean().

void WvConf::load_file WvStringParm  filename  ) 
 

Definition at line 177 of file wvconf.cc.

References WvFDStream::close(), WvError::geterr(), WvStream::getline(), WvFDStream::getrfd(), WvFDStream::isok(), log, WvConfigSection::quick_set(), run_all_callbacks(), WvConfigSection::set(), WvStream::seterr(), trim_string(), and WvConfigSection.

void WvConf::load_file  )  [inline]
 

Definition at line 194 of file wvconf.h.

Referenced by WvConf().

void WvConf::maybeset WvStringParm  section,
WvStringParm  entry,
const char *  value
 

Definition at line 405 of file wvconf.cc.

References get(), maybeset(), and set().

Referenced by maybeset().

void WvConf::maybesetint WvStringParm  section,
WvStringParm  entry,
int  value
 

Definition at line 169 of file wvconf.cc.

References get(), maybesetint(), and setint().

Referenced by maybesetint().

WvConfigSection * WvConf::operator[] WvStringParm  s  ) 
 

Definition at line 413 of file wvconf.cc.

int WvConf::parse_wvconf_request char *  request,
char *&  section,
char *&  entry,
char *&  value
 

Definition at line 96 of file wvconf.cc.

References trim_string().

void WvConf::run_all_callbacks  ) 
 

Definition at line 581 of file wvconf.cc.

Referenced by load_file().

void WvConf::run_callbacks WvStringParm  section,
WvStringParm  entry,
WvStringParm  oldvalue,
WvStringParm  newvalue
 

Definition at line 564 of file wvconf.cc.

References run_callbacks().

Referenced by run_callbacks(), and set().

void WvConf::save  ) 
 

Definition at line 520 of file wvconf.cc.

Referenced by flush().

void WvConf::save WvStringParm  filename  ) 
 

Definition at line 469 of file wvconf.cc.

References WvConfigSection::dump(), WvError::geterr(), WvFDStream::getwfd(), WvFDStream::isok(), log, WvConfigSection::name, and WvStream::print().

void WvConf::set WvStringParm  section,
WvStringParm  entry,
const char *  value
 

Definition at line 354 of file wvconf.cc.

References WvConfigSection::get(), run_callbacks(), WvConfigSection::set(), set(), and WvConfigSection.

Referenced by maybeset(), set(), setint(), and setraw().

void WvConf::set_passwd WvStringParm  user,
WvStringParm  passwd
[inline]
 

Definition at line 223 of file wvconf.h.

void WvConf::set_passwd WvStringParm  sect,
WvStringParm  user,
WvStringParm  passwd
 

WvString WvConf::set_passwd2 WvStringParm  passwd  ) 
 

void WvConf::setbool void *  userdata,
WvStringParm  section,
WvStringParm  entry,
WvStringParm  oldval,
WvStringParm  newval
 

Definition at line 17 of file wvconf.cc.

References log, setbool(), and WvStringParm.

Referenced by add_setbool(), and setbool().

void WvConf::setdirty  )  [inline]
 

Definition at line 231 of file wvconf.h.

void WvConf::setint WvStringParm  section,
WvStringParm  entry,
int  value
 

Definition at line 161 of file wvconf.cc.

References set(), and setint().

Referenced by maybesetint(), and setint().

void WvConf::setraw WvString  wvconfstr,
const char *&  value,
int &  parse_error
 

Definition at line 389 of file wvconf.cc.

References WvString::edit(), get(), parse_wvconf_request(), set(), and setraw().

Referenced by setraw().

bool WvConf::user_exists WvStringParm  user  )  [inline]
 

Definition at line 216 of file wvconf.h.

bool WvConf::user_exists WvStringParm  sect,
WvStringParm  user
 


The documentation for this class was generated from the following files:
Generated on Tue Oct 5 01:09:25 2004 for WvStreams by doxygen 1.3.7