aboutsummaryrefslogtreecommitdiff
path: root/web/mime-url-encoding
blob: 9db088732c6cf73e3651c1846eeeb8ce6acf625f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// file      : web/mime-url-encoding -*- C++ -*-
// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
// license   : MIT; see accompanying LICENSE file

#ifndef WEB_MIME_URL_ENCODING
#define WEB_MIME_URL_ENCODING

#include <string>
#include <iosfwd>

namespace web
{
  // @@ Add the query flag (true by default). If true, then the encoding is
  //    applied to the URL query part, and so the plus character is used to
  //    encode the space character. Audit use cases afterwards.
  //
  void
  mime_url_encode (const char* v, std::ostream& o);

  std::string
  mime_url_encode (const char* v);

  std::string
  mime_url_encode (const std::string& v);

  std::string
  mime_url_decode (const char* b, const char* e, bool trim = false);
}

#endif // WEB_MIME_URL_ENCODING