\doxysection{qpack.\+h}
\hypertarget{qpack_8h_source}{}\label{qpack_8h_source}\index{src/qpack.h@{src/qpack.h}}

\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ \textcolor{comment}{/*******************************************************************************}}
\DoxyCodeLine{00002\ \textcolor{comment}{\ *\ Copyright\ (c)\ 2014,\ Jan\ Koester\ jan.koester@gmx.net}}
\DoxyCodeLine{00003\ \textcolor{comment}{\ *\ All\ rights\ reserved.}}
\DoxyCodeLine{00004\ \textcolor{comment}{\ *\ }}
\DoxyCodeLine{00005\ \textcolor{comment}{\ *\ Redistribution\ and\ use\ in\ source\ and\ binary\ forms,\ with\ or\ without}}
\DoxyCodeLine{00006\ \textcolor{comment}{\ *\ modification,\ are\ permitted\ provided\ that\ the\ following\ conditions\ are\ met:}}
\DoxyCodeLine{00007\ \textcolor{comment}{\ *\ Redistributions\ of\ source\ code\ must\ retain\ the\ above\ copyright}}
\DoxyCodeLine{00008\ \textcolor{comment}{\ *\ \ \ \ \ \ notice,\ this\ list\ of\ conditions\ and\ the\ following\ disclaimer.}}
\DoxyCodeLine{00009\ \textcolor{comment}{\ *\ Redistributions\ in\ binary\ form\ must\ reproduce\ the\ above\ copyright}}
\DoxyCodeLine{00010\ \textcolor{comment}{\ *\ \ \ \ \ \ notice,\ this\ list\ of\ conditions\ and\ the\ following\ disclaimer\ in\ the}}
\DoxyCodeLine{00011\ \textcolor{comment}{\ *\ \ \ \ \ \ documentation\ and/or\ other\ materials\ provided\ with\ the\ distribution.}}
\DoxyCodeLine{00012\ \textcolor{comment}{\ *\ Neither\ the\ name\ of\ the\ <organization>\ nor\ the}}
\DoxyCodeLine{00013\ \textcolor{comment}{\ *\ \ \ \ \ \ names\ of\ its\ contributors\ may\ be\ used\ to\ endorse\ or\ promote\ products}}
\DoxyCodeLine{00014\ \textcolor{comment}{\ *\ \ \ \ \ \ derived\ from\ this\ software\ without\ specific\ prior\ written\ permission.}}
\DoxyCodeLine{00015\ \textcolor{comment}{\ *\ }}
\DoxyCodeLine{00016\ \textcolor{comment}{\ *\ THIS\ SOFTWARE\ IS\ PROVIDED\ BY\ THE\ COPYRIGHT\ HOLDERS\ AND\ CONTRIBUTORS\ "{}AS\ IS"{}\ AND}}
\DoxyCodeLine{00017\ \textcolor{comment}{\ *\ ANY\ EXPRESS\ OR\ IMPLIED\ WARRANTIES,\ INCLUDING,\ BUT\ NOT\ LIMITED\ TO,\ THE\ IMPLIED}}
\DoxyCodeLine{00018\ \textcolor{comment}{\ *\ WARRANTIES\ OF\ MERCHANTABILITY\ AND\ FITNESS\ FOR\ A\ PARTICULAR\ PURPOSE\ ARE}}
\DoxyCodeLine{00019\ \textcolor{comment}{\ *\ DISCLAIMED.\ IN\ NO\ EVENT\ SHALL\ <COPYRIGHT\ HOLDER>\ BE\ LIABLE\ FOR\ ANY}}
\DoxyCodeLine{00020\ \textcolor{comment}{\ *\ DIRECT,\ INDIRECT,\ INCIDENTAL,\ SPECIAL,\ EXEMPLARY,\ OR\ CONSEQUENTIAL\ DAMAGES}}
\DoxyCodeLine{00021\ \textcolor{comment}{\ *\ (INCLUDING,\ BUT\ NOT\ LIMITED\ TO,\ PROCUREMENT\ OF\ SUBSTITUTE\ GOODS\ OR\ SERVICES;}}
\DoxyCodeLine{00022\ \textcolor{comment}{\ *\ LOSS\ OF\ USE,\ DATA,\ OR\ PROFITS;\ OR\ BUSINESS\ INTERRUPTION)\ HOWEVER\ CAUSED\ AND}}
\DoxyCodeLine{00023\ \textcolor{comment}{\ *\ ON\ ANY\ THEORY\ OF\ LIABILITY,\ WHETHER\ IN\ CONTRACT,\ STRICT\ LIABILITY,\ OR\ TORT}}
\DoxyCodeLine{00024\ \textcolor{comment}{\ *\ (INCLUDING\ NEGLIGENCE\ OR\ OTHERWISE)\ ARISING\ IN\ ANY\ WAY\ OUT\ OF\ THE\ USE\ OF\ THIS}}
\DoxyCodeLine{00025\ \textcolor{comment}{\ *\ SOFTWARE,\ EVEN\ IF\ ADVISED\ OF\ THE\ POSSIBILITY\ OF\ SUCH\ DAMAGE.}}
\DoxyCodeLine{00026\ \textcolor{comment}{\ *******************************************************************************/}}
\DoxyCodeLine{00027\ }
\DoxyCodeLine{00028\ \textcolor{preprocessor}{\#pragma\ once}}
\DoxyCodeLine{00029\ }
\DoxyCodeLine{00030\ \textcolor{preprocessor}{\#include\ <cstddef>}}
\DoxyCodeLine{00031\ \textcolor{preprocessor}{\#include\ <cstdint>}}
\DoxyCodeLine{00032\ \textcolor{preprocessor}{\#include\ <string>}}
\DoxyCodeLine{00033\ \textcolor{preprocessor}{\#include\ <vector>}}
\DoxyCodeLine{00034\ }
\DoxyCodeLine{00035\ \textcolor{keyword}{namespace\ }libhttppp::qpack\ \{}
\DoxyCodeLine{00036\ }
\DoxyCodeLine{00037\ \textcolor{keyword}{struct\ }\mbox{\hyperlink{structlibhttppp_1_1qpack_1_1HeaderField}{HeaderField}}\ \{}
\DoxyCodeLine{00038\ \ \ \ \ std::string\ name;}
\DoxyCodeLine{00039\ \ \ \ \ std::string\ value;}
\DoxyCodeLine{00040\ \ \ \ \ \textcolor{keywordtype}{bool}\ incremental\_index\ =\ \textcolor{keyword}{false};}
\DoxyCodeLine{00041\ \};}
\DoxyCodeLine{00042\ }
\DoxyCodeLine{00043\ \textcolor{keyword}{class\ }\mbox{\hyperlink{classlibhttppp_1_1qpack_1_1Encoder}{Encoder}}\ \{}
\DoxyCodeLine{00044\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00045\ \ \ \ \ \textcolor{keyword}{static}\ std::vector<uint8\_t>\ encodeResponseHeaders(uint16\_t\ status\_code,}
\DoxyCodeLine{00046\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::string\ \&content\_type,}
\DoxyCodeLine{00047\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{size\_t}\ content\_length,}
\DoxyCodeLine{00048\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::vector<HeaderField>\ \&extra\ =\ \{\});}
\DoxyCodeLine{00049\ }
\DoxyCodeLine{00050\ \textcolor{keyword}{private}:}
\DoxyCodeLine{00051\ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keywordtype}{void}\ encodeInt(std::vector<uint8\_t>\ \&out,\ uint8\_t\ prefix\_byte,}
\DoxyCodeLine{00052\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ uint8\_t\ prefix\_bits,\ uint64\_t\ value);}
\DoxyCodeLine{00053\ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keywordtype}{void}\ encodeString(std::vector<uint8\_t>\ \&out,\ \textcolor{keyword}{const}\ std::string\ \&s);}
\DoxyCodeLine{00054\ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keywordtype}{void}\ encodeIndexedStatic(std::vector<uint8\_t>\ \&out,\ uint64\_t\ index);}
\DoxyCodeLine{00055\ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keywordtype}{void}\ encodeLiteralStaticNameRef(std::vector<uint8\_t>\ \&out,}
\DoxyCodeLine{00056\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ uint64\_t\ name\_index,}
\DoxyCodeLine{00057\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::string\ \&value);}
\DoxyCodeLine{00058\ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keywordtype}{void}\ encodeLiteralName(std::vector<uint8\_t>\ \&out,}
\DoxyCodeLine{00059\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::string\ \&name,}
\DoxyCodeLine{00060\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::string\ \&value);}
\DoxyCodeLine{00061\ \};}
\DoxyCodeLine{00062\ }
\DoxyCodeLine{00063\ \textcolor{keyword}{class\ }\mbox{\hyperlink{classlibhttppp_1_1qpack_1_1Decoder}{Decoder}}\ \{}
\DoxyCodeLine{00064\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00065\ \ \ \ \ \textcolor{keyword}{static}\ std::vector<HeaderField>\ decode(\textcolor{keyword}{const}\ uint8\_t\ *data,\ \textcolor{keywordtype}{size\_t}\ len);}
\DoxyCodeLine{00066\ \textcolor{keyword}{private}:}
\DoxyCodeLine{00067\ \ \ \ \ \textcolor{keyword}{struct\ }StaticEntry\ \{\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *name;\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *value;\ \};}
\DoxyCodeLine{00068\ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keyword}{const}\ StaticEntry\ STATIC\_TABLE[];}
\DoxyCodeLine{00069\ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{size\_t}\ STATIC\_TABLE\_SIZE;}
\DoxyCodeLine{00070\ \};}
\DoxyCodeLine{00071\ }
\DoxyCodeLine{00072\ \}\ \textcolor{comment}{//\ namespace\ libhttppp::qpack}}

\end{DoxyCode}
