LoadableModules.h \
LoadableModules.cc
-SUBDIRS = base anyp comm eui acl format fs repl
-DIST_SUBDIRS = base anyp comm eui acl format fs repl
+SUBDIRS = base anyp parser comm eui acl format fs repl
+DIST_SUBDIRS = base anyp parser comm eui acl format fs repl
if ENABLE_AUTH
SUBDIRS += auth
$(ESI_LIBS) \
$(SSL_LIBS) \
$(SNMP_LIBS) \
+ parser/libsquid-parser.la \
$(top_builddir)/lib/libmisccontainers.la \
$(top_builddir)/lib/libmiscencoding.la \
$(top_builddir)/lib/libmiscutil.la \
--- /dev/null
+#ifndef _SQUID_SRC_PARSER_CHARACTERSET_H
+#define _SQUID_SRC_PARSER_CHARACTERSET_H
+
+#include <map>
+
+namespace Parser {
+
+class CharacterSet
+{
+public:
+ CharacterSet(const char *label, const char * const c) : name_(label) {
+ memset(match_, 0, sizeof(match_));
+ const size_t = strlen(c);
+ for (size_t i = 0; i < len; ++i) {
+ match_[static_cast<uint8_t>(c)] = true;
+ }
+ }
+
+ /// whether a given character exists in the set
+ bool operator[](char t) const {return match_[static_cast<uint8_t>(c)];}
+
+ void add(const char c) {match_[static_cast<uint8_t>(c)] = true;}
+
+ /// add all characters from the given CharacterSet to this one
+ const CharacterSet &operator +=(const CharacterSet &src) {
+ for (size_t i = 0; i < 256; ++i) {
+ if(src.match_[i])
+ match_[i] = true;
+ }
+ return *this;
+ }
+
+private:
+ char * name_;
+ std::map<bool> chars_;
+};
+
+} // namespace Parser
+
+#endif /* _SQUID_SRC_PARSER_CHARACTERSET_H */
--- /dev/null
+include $(top_srcdir)/src/Common.am
+
+noinst_LTLIBRARIES = libsquid-parser.la
+
+libsquid_parser_la_SOURCES = \
+ CharacterSet.h