NAWA 0.8
Web Application Framework for C++
encoding.h
Go to the documentation of this file.
1
6/*
7 * Copyright (C) 2019-2021 Tobias Flaig.
8 *
9 * This file is part of nawa.
10 *
11 * nawa is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License,
13 * version 3, as published by the Free Software Foundation.
14 *
15 * nawa is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public License
21 * along with nawa. If not, see <https://www.gnu.org/licenses/>.
22 */
23
24#ifndef NAWA_ENCODING_H
25#define NAWA_ENCODING_H
26
27#include <string>
28
32namespace nawa::encoding {
41 std::string htmlEncode(std::string input, bool encodeAll = false);
42
51 std::string htmlDecode(std::string input);
52
59 std::string urlEncode(std::string const& input);
60
66 std::string urlDecode(std::string input);
67
74 bool isBase64(std::string const& input, bool allowWhitespaces = true);
75
84 std::string base64Encode(std::string const& input, size_t breakAfter = 0, std::string const& breakSequence = "");
85
93 std::string base64Decode(std::string const& input);
94
104 std::string quotedPrintableEncode(std::string const& input, std::string const& lineEnding = "\r\n",
105 bool replaceCrlf = false, bool qEncoding = false);
106
114 std::string quotedPrintableDecode(std::string input, bool qEncoding = false);
115
124 std::string makeEncodedWord(std::string const& input, bool base64 = false, bool onlyIfNecessary = true);
125
132 std::string punycodeEncode(std::string const& input);
133
140 std::string punycodeDecode(std::string const& input);
141}// namespace nawa::encoding
142
143#endif//NAWA_ENCODING_H
std::string quotedPrintableDecode(std::string input, bool qEncoding=false)
Definition: encoding.cpp:321
std::string punycodeDecode(std::string const &input)
Definition: encoding.cpp:381
std::string base64Encode(std::string const &input, size_t breakAfter=0, std::string const &breakSequence="")
Definition: encoding.cpp:281
std::string quotedPrintableEncode(std::string const &input, std::string const &lineEnding="\r\n", bool replaceCrlf=false, bool qEncoding=false)
Definition: encoding.cpp:290
std::string urlDecode(std::string input)
Definition: encoding.cpp:256
std::string punycodeEncode(std::string const &input)
Definition: encoding.cpp:356
std::string makeEncodedWord(std::string const &input, bool base64=false, bool onlyIfNecessary=true)
Definition: encoding.cpp:340
std::string htmlEncode(std::string input, bool encodeAll=false)
Definition: encoding.cpp:133
std::string urlEncode(std::string const &input)
Definition: encoding.cpp:238
std::string htmlDecode(std::string input)
Definition: encoding.cpp:185
bool isBase64(std::string const &input, bool allowWhitespaces=true)
Definition: encoding.cpp:270
std::string base64Decode(std::string const &input)
Definition: encoding.cpp:286