]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
CharacterSet: update RFC723x references and add some missing sets
authorAmos Jeffries <squid3@treenet.co.nz>
Sat, 7 Jun 2014 10:23:47 +0000 (03:23 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Sat, 7 Jun 2014 10:23:47 +0000 (03:23 -0700)
src/base/CharacterSet.cc
src/base/CharacterSet.h

index 920253415798aabda5b16233e0af12b1f07e3e10..95d7045d3f77190151efe7c3e35feb03fa5a6a03 100644 (file)
@@ -58,20 +58,35 @@ CharacterSet::CharacterSet(const char *label, unsigned char low, unsigned char h
 }
 
 const CharacterSet
+// RFC 5234
 CharacterSet::ALPHA("ALPHA", "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"),
 CharacterSet::BIT("BIT","01"),
 CharacterSet::CR("CR","\r"),
-CharacterSet::LF("LF","\n"),
+#if __cplusplus == 201103L
+//CharacterSet::CTL("CTL",{{0x01,0x1f},{0x7f,0x7f}}),
+#endif
 CharacterSet::DIGIT("DIGIT","0123456789"),
 CharacterSet::DQUOTE("DQUOTE","\""),
-CharacterSet::HTAB("HTAB","\t"),
 CharacterSet::HEXDIG("HEXDIG","0123456789aAbBcCdDeEfF"),
+CharacterSet::HTAB("HTAB","\t"),
+CharacterSet::LF("LF","\n"),
 CharacterSet::SP("SP"," "),
 CharacterSet::VCHAR("VCHAR", 0x21, 0x7e),
+// RFC 7230
 CharacterSet::WSP("WSP"," \t"),
+#if __cplusplus == 201103L
+//CharacterSet::CTEXT("ctext",{{0x09,0x09},{0x20,0x20},{0x2a,0x5b},{0x5d,0x7e},{0x80,0xff}}),
+#endif
 CharacterSet::TCHAR("TCHAR","!#$%&'*+-.^_`|~0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"),
-CharacterSet::SPECIAL("SPECIAL","()<>@,;:\\\"/[]?={}")
-// QDTEXT and OBSTEXT are omitted for now as they require c++11 constructors
-//,CharacterSet::QDTEXT("QDTEXT",{{9,9},{0x20,0x21},{0x23,0x5b},{0x5d,0x7e},{0x80,0xff}})
-//,CharacterSet::OBSTEXT("OBSTEXT",0x80,0xff)
+CharacterSet::SPECIAL("SPECIAL","()<>@,;:\\\"/[]?={}"),
+#if __cplusplus == 201103L
+//CharacterSet::QDTEXT("QDTEXT",{{0x09,0x09},{0x20,0x21},{0x23,0x5b},{0x5d,0x7e},{0x80,0xff}}),
+#endif
+CharacterSet::OBSTEXT("OBSTEXT",0x80,0xff),
+// RFC 7232
+#if __cplusplus == 201103L
+//CharacterSet::ETAGC("ETAGC",{{0x21,0x21},{0x23,0x7e},{0x80,0xff}}),
+#endif
+// RFC 7235
+CharacterSet::TOKEN68C("TOKEN68C","-._~+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
 ;
index 4ab86b32fe3da7d6582adc66e2a9fb5d6e457925..8fd809af04fcbfc5a694d19355d8a17fb9fb460a 100644 (file)
@@ -36,38 +36,64 @@ public:
     /// optional set label for debugging (default: "anonymous")
     const char * name;
 
-    // common character sets, insipired to RFC5234
+    // common character sets, RFC 5234
     // A-Za-z
     static const CharacterSet ALPHA;
     // 0-1
     static const CharacterSet BIT;
     // carriage return
     static const CharacterSet CR;
-    // line feed
-    static const CharacterSet LF;
-    // double quote
-    static const CharacterSet DQUOTE;
+    // controls
+#if __cplusplus == 201103L
+    // ready but disabled as needs C++11 constructor
+    //static const CharacterSet CTL;
+#endif
     // 0-9
     static const CharacterSet DIGIT;
+    // double quote
+    static const CharacterSet DQUOTE;
     // 0-9aAbBcCdDeEfF
     static const CharacterSet HEXDIG;
     // horizontal tab
     static const CharacterSet HTAB;
+    // line feed
+    static const CharacterSet LF;
     // white space
     static const CharacterSet SP;
     // visible (printable) characters
     static const CharacterSet VCHAR;
     // <space><tab>
     static const CharacterSet WSP;
-    // character sets from draft httpbis
+
+    // HTTP character sets, RFC 7230
+    // ctext
+#if __cplusplus == 201103L
+    // ready but disabled as needs C++11 constructor
+    //static const CharacterSet CTEXT;
+#endif
+    // XXX: maybe field-vchar = VCHAR / obs-text
     // any VCHAR except for SPECIAL
     static const CharacterSet TCHAR;
     // special VCHARs
     static const CharacterSet SPECIAL;
-    // qdtext (ready but not enabled as it requires a c++11 constructor)
+    // qdtext
+#if __cplusplus == 201103L
+    // ready but disabled as needs C++11 constructor
     //static const CharacterSet QDTEXT;
-    // obs-text (ready but not enabled as it requires a c++11 constructor)
-    //static const CharacterSet OBSTEXT;
+#endif
+    // obs-text
+    static const CharacterSet OBSTEXT;
+
+    // HTTP character sets, RFC 7232
+    // etagc
+#if __cplusplus == 201103L
+    // ready but disabled as needs C++11 constructor
+    //static const CharacterSet ETAGC;
+#endif
+
+    // HTTP character sets, RFC 7235
+    // token68 (internal charaters only, excludes '=' terminator)
+    static const CharacterSet TOKEN68C;
 
 private:
     /** index of characters in this set