|
0
|
1 |
#ifndef VMAILMGR__CONFIG_IO__H__
|
|
|
2 |
#define VMAILMGR__CONFIG_IO__H__
|
|
|
3 |
|
|
|
4 |
#include "mystring/mystring.h"
|
|
|
5 |
#include "config/configrc.h"
|
|
|
6 |
|
|
|
7 |
bool config_read(const mystring& dir, const mystring& name, mystring& result);
|
|
|
8 |
|
|
|
9 |
#define cval(TYPE,FN,VAL,EXT) static TYPE default_##FN = VAL; \
|
|
|
10 |
static mystring filename_##FN(#FN); \
|
|
|
11 |
TYPE configuration:: FN () const { return read_##EXT (filename_##FN, default_##FN); }
|
|
|
12 |
#define cval_str(FN,VAL) cval(mystring,FN,VAL,str)
|
|
|
13 |
#define cval_dir(FN,VAL) cval(mystring,FN,VAL,dir)
|
|
|
14 |
#define cval_uns(FN,VAL) cval(unsigned,FN,VAL,uns)
|
|
|
15 |
|
|
|
16 |
#endif
|