]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/ConfigOption.h
2 * Copyright (C) 1996-2014 The Squid Software Foundation and contributors
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
9 #ifndef SQUID_CONFIGOPTION_H
10 #define SQUID_CONFIGOPTION_H
16 /* cache option parsers */
22 virtual ~ConfigOption() {}
24 virtual bool parse(char const *option
, const char *value
, int reconfiguring
) = 0;
25 virtual void dump(StoreEntry
* e
) const = 0;
28 class ConfigOptionVector
: public ConfigOption
32 virtual ~ConfigOptionVector();
33 virtual bool parse(char const *option
, const char *value
, int reconfiguring
);
34 virtual void dump(StoreEntry
* e
) const;
35 std::vector
<ConfigOption
*>options
;
39 class ConfigOptionAdapter
: public ConfigOption
43 ConfigOptionAdapter(C
& theObject
, bool (C::*parseFP
)(char const *option
, const char *value
, int reconfiguring
), void (C::*dumpFP
)(StoreEntry
* e
) const) : object(theObject
), parser(parseFP
), dumper(dumpFP
) {}
45 bool parse(char const *option
, const char *value
, int isaReconf
) {
47 return (object
.*parser
)(option
, value
, isaReconf
);
52 void dump(StoreEntry
* e
) const {
59 bool (C::*parser
)(char const *option
, const char *value
, int reconfiguring
) ;
60 void (C::*dumper
)(StoreEntry
* e
) const;
63 #endif /* SQUID_CONFIGOPTION_H */