]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/acl/HierCodeData.cc
3e5e17cdea1274994344ee43e67be746634333cb
2 #include "acl/HierCodeData.h"
3 #include "acl/Checklist.h"
7 ACLHierCodeData::ACLHierCodeData()
9 // initialize mask to NULL
10 memset(values
, 0, sizeof(values
));
13 ACLHierCodeData::ACLHierCodeData(ACLHierCodeData
const &old
)
15 memcpy(values
, old
.values
, sizeof(values
) );
18 ACLHierCodeData::~ACLHierCodeData()
22 ACLHierCodeData::match(hier_code toFind
)
24 return values
[toFind
];
28 ACLHierCodeData::dump()
32 for (hier_code iter
=HIER_NONE
; iter
<HIER_MAX
; ++iter
) {
33 if (!values
[iter
]) continue;
34 wordlistAdd(&W
, hier_code_str
[iter
]);
41 ACLHierCodeData::parse()
45 while ((t
= strtokFile())) {
46 for (hier_code iter
= HIER_NONE
; iter
<= HIER_MAX
; ++iter
) {
47 if (iter
== HIER_MAX
) {
48 fatalf("ERROR: No such hier_code '%s'",t
);
51 if (strcmp(hier_code_str
[iter
],t
) == 0) {
53 break; // back to while-loop
60 ACLHierCodeData::empty() const
62 for (hier_code iter
= HIER_NONE
; iter
<= HIER_MAX
; ++iter
) {
63 if (values
[iter
]) return false; // not empty.
69 ACLHierCodeData::clone() const
71 return new ACLHierCodeData(*this);