Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
url-coding.h
Go to the documentation of this file.
1 // Copyright 2012 Cloudera Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef UTIL_URL_CODING_H
16 #define UTIL_URL_CODING_H
17 
18 #include <string>
19 #include <vector>
20 #include <boost/cstdint.hpp>
21 
22 namespace impala {
23 
29 void UrlEncode(const std::string& in, std::string* out, bool hive_compat = false);
30 void UrlEncode(const std::vector<uint8_t>& in, std::string* out,
31  bool hive_compat = false);
32 
38 bool UrlDecode(const std::string& in, std::string* out, bool hive_compat = false);
39 
43 void Base64Encode(const std::vector<uint8_t>& in, std::string* out);
44 void Base64Encode(const std::vector<uint8_t>& in, std::stringstream* out);
45 void Base64Encode(const std::string& in, std::string* out);
46 void Base64Encode(const std::string& in, std::stringstream* out);
47 
51 bool Base64Decode(const std::string& in, std::string* out);
52 
58 void EscapeForHtml(const std::string& in, std::stringstream* out);
59 
60 }
61 
62 #endif
bool UrlDecode(const string &in, string *out, bool hive_compat)
Definition: url-coding.cc:84
static void Base64Encode(const char *in, int in_len, stringstream *out)
Definition: url-coding.cc:110
static void UrlEncode(const char *in, int in_len, string *out, bool hive_compat)
Definition: url-coding.cc:48
bool Base64Decode(const string &in, string *out)
Definition: url-coding.cc:155
void EscapeForHtml(const string &in, stringstream *out)
Definition: url-coding.cc:178