NCBI C++ ToolKit
cgi_util.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef CGI___CGI_UTIL__HPP
2 #define CGI___CGI_UTIL__HPP
3 
4 /* $Id: cgi_util.hpp 53572 2012-03-28 14:45:54Z ivanov $
5  * ===========================================================================
6  *
7  * PUBLIC DOMAIN NOTICE
8  * National Center for Biotechnology Information
9  *
10  * This software/database is a "United States Government Work" under the
11  * terms of the United States Copyright Act. It was written as part of
12  * the author's official duties as a United States Government employee and
13  * thus cannot be copyrighted. This software/database is freely available
14  * to the public for use. The National Library of Medicine and the U.S.
15  * Government have not placed any restriction on its use or reproduction.
16  *
17  * Although all reasonable efforts have been taken to ensure the accuracy
18  * and reliability of the software and data, the NLM and the U.S.
19  * Government do not and cannot warrant the performance or results that
20  * may be obtained by using this software or data. The NLM and the U.S.
21  * Government disclaim all warranties, express or implied, including
22  * warranties of performance, merchantability or fitness for any particular
23  * purpose.
24  *
25  * Please cite the author in any work or product based on this material.
26  *
27  * ===========================================================================
28  *
29  * Authors: Alexey Grichenko
30  *
31  */
32 
33 /// @file cont_util.hpp
34 ///
35 /// CGI related utility classes and functions.
36 ///
37 
38 #include <util/ncbi_url.hpp>
39 
40 /** @addtogroup CGI
41  *
42  * @{
43  */
44 
46 
47 
48 /////////////////////////////////////////////////////////////////////////////
49 //
50 // DEPRECATED
51 //
52 /////////////////////////////////////////////////////////////////////////////
53 
54 
55 /// @deprecated Use NStr::EUrlEncode
56 enum EUrlEncode {
62 };
63 
64 /// @deprecated Use NStr::EUrlDecode
65 enum EUrlDecode {
68 };
69 
70 
71 /// @deprecated Use NStr::URLDecode()
74 extern string
75 URL_DecodeString(const string& str,
76  EUrlEncode encode_flag = eUrlEncode_SkipMarkChars);
77 
78 /// @deprecated Use NStr::URLDecodeInPlace()
81 extern SIZE_TYPE
82 URL_DecodeInPlace(string& str, EUrlDecode decode_flag = eUrlDecode_All);
83 
84 /// @deprecated Use NStr::URLEncode()
87 extern string
88 URL_EncodeString(const string& str,
89  EUrlEncode encode_flag = eUrlEncode_SkipMarkChars);
90 
91 
92 /// @deprecated Use CUrlArgs_Parser
94 {
95 public:
96  CCgiArgs_Parser(void) {}
97  void SetQueryString(const string& query, EUrlEncode encode)
99  void SetQueryString(const string& query,
100  const IUrlEncoder* encoder = 0)
102 };
103 
104 
105 /// @deprecated Use CUrlArgs
107 {
108 public:
109  CCgiArgs(void) {}
110  CCgiArgs(const string& query, EUrlEncode decode)
112  string GetQueryString(EAmpEncoding amp_enc,
113  EUrlEncode encode) const
114  { return CUrlArgs::GetQueryString(amp_enc, NStr::EUrlEncode(encode)); }
115 };
116 
117 
119 
120 #endif /* CGI___CGI_UTIL__HPP */
CUrlArgs_Parser::
Definition: ncbi_url.hpp:170
CUrlArgs::
Definition: ncbi_url.hpp:240
IUrlEncoder::
Definition: ncbi_url.hpp:57
NStr –.
Definition: ncbistr.hpp:243
#define NCBI_DEPRECATED_CLASS
Macro used to mark a class as deprecated.
Definition: ncbimisc.hpp:1215
string URL_DecodeString(const string &str, EUrlEncode encode_flag=eUrlEncode_SkipMarkChars)
Definition: cgi_util.cpp:51
NCBI_DEPRECATED_CLASS NCBI_XCGI_EXPORT CCgiArgs
Definition: cgi_util.hpp:102
SIZE_TYPE URL_DecodeInPlace(string &str, EUrlDecode decode_flag=eUrlDecode_All)
Definition: cgi_util.cpp:44
void SetQueryString(const string &query, const IUrlEncoder *encoder=0)
Definition: cgi_util.hpp:99
string URL_EncodeString(const string &str, EUrlEncode encode_flag=eUrlEncode_SkipMarkChars)
Definition: cgi_util.cpp:62
EUrlEncode
Definition: cgi_util.hpp:56
NCBI_DEPRECATED_CLASS NCBI_XCGI_EXPORT EUrlEncode decode
Definition: cgi_util.hpp:111
NCBI_DEPRECATED_CLASS NCBI_XCGI_EXPORT EUrlEncode encode
Definition: cgi_util.hpp:98
string GetQueryString(EAmpEncoding amp_enc, EUrlEncode encode) const
Definition: cgi_util.hpp:112
EUrlDecode
Definition: cgi_util.hpp:65
NCBI_DEPRECATED_CLASS NCBI_XCGI_EXPORT CCgiArgs_Parser
Definition: cgi_util.hpp:97
@ eUrlEncode_None
Definition: cgi_util.hpp:57
@ eUrlEncode_SkipMarkChars
Definition: cgi_util.hpp:58
@ eUrlEncode_PercentOnly
Definition: cgi_util.hpp:60
@ eUrlEncode_ProcessMarkChars
Definition: cgi_util.hpp:59
@ eUrlEncode_Path
Definition: cgi_util.hpp:61
@ eUrlDecode_All
Definition: cgi_util.hpp:66
@ eUrlDecode_Percent
Definition: cgi_util.hpp:67
#define NCBI_DEPRECATED
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
NCBI_NS_STD::string::size_type SIZE_TYPE
Definition: ncbistr.hpp:132
EUrlEncode
URL-encode flags.
Definition: ncbistr.hpp:3141
@ eUrlEnc_ProcessMarkChars
Convert all non-alphanumeric chars, spaces are converted to '+'.
Definition: ncbistr.hpp:3143
@ eUrlEnc_None
Do not encode.
Definition: ncbistr.hpp:3154
@ eUrlEnc_PercentOnly
Convert all non-alphanumeric chars including space and '' to %## format.
Definition: ncbistr.hpp:3144
@ eUrlEnc_Path
Same as ProcessMarkChars but preserves valid path characters ('/', '.')
Definition: ncbistr.hpp:3145
@ eUrlEnc_SkipMarkChars
Do not convert chars like '!', '(' etc.
Definition: ncbistr.hpp:3142
@ eUrlDec_All
Decode '+' to space.
Definition: ncbistr.hpp:3158
@ eUrlDec_Percent
Decode only XX.
Definition: ncbistr.hpp:3159
string GetQueryString(EAmpEncoding amp_enc, NStr::EUrlEncode encode) const
Construct and return complete query string.
Definition: ncbi_url.cpp:225
void SetQueryString(const string &query, NStr::EUrlEncode encode)
Parse query string, call AddArgument() to store each value.
Definition: ncbi_url.cpp:49
#define NCBI_XCGI_EXPORT
Definition: ncbi_export.h:1097
static const char * str(char *buf, int n)
Definition: stats.c:84
static string query
Modified on Wed Feb 28 07:11:31 2024 by modify_doxy.py rev. 669887