]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/acl/CharacterSetOption.h
2 * Copyright (C) 1996-2020 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_ACL_CHARACTER_SET_OPTION_H
10 #define SQUID_ACL_CHARACTER_SET_OPTION_H
12 #include "acl/Options.h"
13 #include "base/CharacterSet.h"
14 #include "sbuf/SBuf.h"
18 typedef OptionValue
<CharacterSet
> CharacterSetOptionValue
;
20 /* TypedOption<CharacterSetOptionValue> specializations */
25 TypedOption
<CharacterSetOptionValue
>::import(const SBuf
&rawValue
) const
27 SBuf chars
= rawValue
; // because c_str() is not constant
28 recipient_
->value
= CharacterSet(__FILE__
, chars
.c_str());
34 TypedOption
<CharacterSetOptionValue
>::print(std::ostream
&os
) const
36 recipient_
->value
.printChars(os
); // TODO: Quote if needed.
39 /// option value to configure one or more characters (e.g., -m=",;")
40 class CharacterSetOption
: public TypedOption
<CharacterSetOptionValue
>
43 typedef TypedOption
<CharacterSetOptionValue
> Parent
;
44 CharacterSetOption(): Parent(valueOptional
) {}
49 #endif /* SQUID_ACL_CHARACTER_SET_OPTION_H */