/usr/include/wvstreams/unifilesystemgen.h is in libwvstreams-dev 4.6.1-7.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | #ifndef __UNIFILESYSTEMGEN_H
#define __UNIFILESYSTEMGEN_H
#include "uniconfgen.h"
#include <sys/types.h>
/**
* Creates a UniConf tree that mirrors some point in the Linux filesystem,
* with restrictions. The root of the point to be mirrored is a directory
* name. Additionally, the mode for creation of all files and directories
* must be given.
*
* UniConf keys are mapped to filesystem paths in the obvious way (delimit
* and precede the list of names with "/", then append to the path for the
* point being mirrored).
*
* Keys corresponding to regular files have value equal to the content of
* that file (plus a terminating NUL). Keys whose corresponding pathname
* does not exist have value equal to the null string. Keys corresponding
* to things other than regular files have value equal to the empty string,
* unless their last segment is "." or "..", in which case they have value
* equal to the null string.
*
* Due to these definitions, the UniFileSystemGen violates the UniConfGen
* semantics in that it is not possible for a key to have simultaneously a
* non-empty value and children and it is not possible for a key named
* "." or ".." to exist. Any set operation that by the UniConfGen semantics
* would cause either of those things to be true will instead do nothing.
* These shortcomings are permanent.
*
* If an unrecoverable error occurs during set, it will fail, but will
* possibly still have an effect. If an unrecoverable error occurs
* during get, it will return the null string. If an unrecoverable error
* occurs during iterator(), it will return a NULL pointer.
*
* Presently, callbacks are never triggered.
*
* Files containing embedded NUL characters don't currently work quite right
* because WvString can't deal with them. They'll stop at the first NUL.
*/
class UniFileSystemGen : public UniConfGen
{
public:
UniFileSystemGen(WvStringParm _dir, mode_t _mode);
virtual WvString get(const UniConfKey &key);
virtual void set(const UniConfKey &key, WvStringParm value);
virtual void setv(const UniConfPairList &pairs);
virtual void flush_buffers() {}
virtual Iter *iterator(const UniConfKey &key);
private:
WvString dir;
mode_t mode;
};
#endif
|