\hypertarget{encode_8hpp}{}\section{encode.\+hpp File Reference} \label{encode_8hpp}\index{encode.hpp@{encode.hpp}} Functions to encode/decode strings. {\ttfamily \#include \char`\"{}libfilezilla.\+hpp\char`\"{}}\newline {\ttfamily \#include $<$string$>$}\newline {\ttfamily \#include $<$vector$>$}\newline Include dependency graph for encode.\+hpp\+: \nopagebreak \begin{figure}[H] \begin{center} \leavevmode \includegraphics[width=350pt]{encode_8hpp__incl} \end{center} \end{figure} This graph shows which files directly or indirectly include this file\+: \nopagebreak \begin{figure}[H] \begin{center} \leavevmode \includegraphics[width=151pt]{encode_8hpp__dep__incl} \end{center} \end{figure} \subsection*{Namespaces} \begin{DoxyCompactItemize} \item \mbox{\hyperlink{namespacefz}{fz}} \begin{DoxyCompactList}\small\item\em The namespace used by libfilezilla. \end{DoxyCompactList}\end{DoxyCompactItemize} \subsection*{Enumerations} \begin{DoxyCompactItemize} \item enum \mbox{\hyperlink{namespacefz_acef92760774f58e04aff46410db2261a}{base64\+\_\+type}} \{ {\bfseries standard}, {\bfseries url} \} \begin{DoxyCompactList}\small\item\em Alphabet variations for base64. \end{DoxyCompactList}\end{DoxyCompactItemize} \subsection*{Functions} \begin{DoxyCompactItemize} \item {\footnotesize template$<$typename Char $>$ }\\int \mbox{\hyperlink{namespacefz_a5f0aaa9b005d78645111219b39d3ea44}{hex\+\_\+char\+\_\+to\+\_\+int}} (Char c) \begin{DoxyCompactList}\small\item\em Converts a hex digit to decimal int. \end{DoxyCompactList}\item \mbox{\Hypertarget{namespacefz_aab9280a63926d6f19bbb5de2e17456ff}\label{namespacefz_aab9280a63926d6f19bbb5de2e17456ff}} {\footnotesize template$<$typename Out\+String = std\+::vector$<$uint8\+\_\+t$>$$>$ }\\Out\+String {\bfseries hex\+\_\+decode} (std\+::string\+\_\+view const \&in) \item \mbox{\Hypertarget{namespacefz_afeaa30a4b62dae4d06278730a602c837}\label{namespacefz_afeaa30a4b62dae4d06278730a602c837}} {\footnotesize template$<$typename Out\+String = std\+::vector$<$uint8\+\_\+t$>$$>$ }\\Out\+String {\bfseries hex\+\_\+decode} (std\+::wstring\+\_\+view const \&in) \item {\footnotesize template$<$typename Char = char, bool Lowercase = true$>$ }\\Char \mbox{\hyperlink{namespacefz_a7cd52bee449cb17dbd6952d4217b4b4b}{int\+\_\+to\+\_\+hex\+\_\+char}} (int d) \begin{DoxyCompactList}\small\item\em Converts an integer to the corresponding lowercase hex digit. \end{DoxyCompactList}\item \mbox{\Hypertarget{namespacefz_ab56c9b08d2febad84eeb81ad4999508c}\label{namespacefz_ab56c9b08d2febad84eeb81ad4999508c}} {\footnotesize template$<$typename String , typename In\+String , bool Lowercase = true$>$ }\\String {\bfseries hex\+\_\+encode} (In\+String const \&data) \item \mbox{\Hypertarget{namespacefz_af1f723fab10f456befc1f8721197de62}\label{namespacefz_af1f723fab10f456befc1f8721197de62}} std\+::string \mbox{\hyperlink{namespacefz_af1f723fab10f456befc1f8721197de62}{base64\+\_\+encode}} (std\+::string\+\_\+view const \&in, base64\+\_\+type type=base64\+\_\+type\+::standard, bool pad=true) \begin{DoxyCompactList}\small\item\em Encodes raw input string to base64. \end{DoxyCompactList}\item \mbox{\Hypertarget{namespacefz_a0888da68c39e7c41fda6778f77e3e707}\label{namespacefz_a0888da68c39e7c41fda6778f77e3e707}} std\+::string {\bfseries base64\+\_\+encode} (std\+::vector$<$ uint8\+\_\+t $>$ const \&in, base64\+\_\+type type=base64\+\_\+type\+::standard, bool pad=true) \item std\+::string \mbox{\hyperlink{namespacefz_ac093add794c4cf4ae8f7ee2cca62255c}{base64\+\_\+decode}} (std\+::string\+\_\+view const \&in) \begin{DoxyCompactList}\small\item\em Decodes base64, ignores whitespace. Returns empty string on invalid input. \end{DoxyCompactList}\item std\+::string \mbox{\hyperlink{namespacefz_aec806ac93540158d944a040100cfa3c4}{percent\+\_\+encode}} (std\+::string\+\_\+view const \&s, bool keep\+\_\+slashes=false) \begin{DoxyCompactList}\small\item\em Percent-\/enodes string. \end{DoxyCompactList}\item \mbox{\Hypertarget{namespacefz_a0ac94132960adf6494647182fc487785}\label{namespacefz_a0ac94132960adf6494647182fc487785}} std\+::string {\bfseries percent\+\_\+encode} (std\+::wstring\+\_\+view const \&s, bool keep\+\_\+slashes=false) \item std\+::wstring \mbox{\hyperlink{namespacefz_a7b964bc07874672b829284120b13fc0c}{percent\+\_\+encode\+\_\+w}} (std\+::wstring\+\_\+view const \&s, bool keep\+\_\+slashes=false) \begin{DoxyCompactList}\small\item\em Percent-\/encodes wide-\/character. Non-\/\+A\+S\+C\+II characters are converted to U\+T\+F-\/8 befor they are encoded. \end{DoxyCompactList}\item std\+::string \mbox{\hyperlink{namespacefz_a43909bc7da088eb3c74c3e9430a45259}{percent\+\_\+decode}} (std\+::string\+\_\+view const \&s, bool allow\+\_\+embedded\+\_\+null=false) \begin{DoxyCompactList}\small\item\em Percent-\/decodes string. \end{DoxyCompactList}\end{DoxyCompactItemize} \subsection{Detailed Description} Functions to encode/decode strings. Defines functions to deal with hex, base64 and percent encoding.