]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/acl/HierCodeData.cc
2 #include "acl/Checklist.h"
3 #include "acl/HierCodeData.h"
8 ACLHierCodeData::ACLHierCodeData()
10 // initialize mask to NULL
11 memset(values
, 0, sizeof(values
));
14 ACLHierCodeData::ACLHierCodeData(ACLHierCodeData
const &old
)
16 memcpy(values
, old
.values
, sizeof(values
) );
19 ACLHierCodeData::~ACLHierCodeData()
23 ACLHierCodeData::match(hier_code toFind
)
25 return values
[toFind
];
29 ACLHierCodeData::dump()
33 for (hier_code iter
=HIER_NONE
; iter
<HIER_MAX
; ++iter
) {
34 if (!values
[iter
]) continue;
35 wordlistAdd(&W
, hier_code_str
[iter
]);
42 ACLHierCodeData::parse()
46 while ((t
= strtokFile())) {
47 for (hier_code iter
= HIER_NONE
; iter
<= HIER_MAX
; ++iter
) {
48 if (iter
== HIER_MAX
) {
49 fatalf("ERROR: No such hier_code '%s'",t
);
52 if (strcmp(hier_code_str
[iter
],t
) == 0) {
54 break; // back to while-loop
61 ACLHierCodeData::empty() const
63 for (hier_code iter
= HIER_NONE
; iter
<= HIER_MAX
; ++iter
) {
64 if (values
[iter
]) return false; // not empty.
70 ACLHierCodeData::clone() const
72 return new ACLHierCodeData(*this);