NCBI C++ ToolKit
egquery.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: egquery.cpp 39804 2008-10-21 19:34:42Z grichenk $
2 * ===========================================================================
3 *
4 * PUBLIC DOMAIN NOTICE
5 * National Center for Biotechnology Information
6 *
7 * This software/database is a "United States Government Work" under the
8 * terms of the United States Copyright Act. It was written as part of
9 * the author's official duties as a United States Government employee and
10 * thus cannot be copyrighted. This software/database is freely available
11 * to the public for use. The National Library of Medicine and the U.S.
12 * Government have not placed any restriction on its use or reproduction.
13 *
14 * Although all reasonable efforts have been taken to ensure the accuracy
15 * and reliability of the software and data, the NLM and the U.S.
16 * Government do not and cannot warrant the performance or results that
17 * may be obtained by using this software or data. The NLM and the U.S.
18 * Government disclaim all warranties, express or implied, including
19 * warranties of performance, merchantability or fitness for any particular
20 * purpose.
21 *
22 * Please cite the author in any work or product based on this material.
23 *
24 * ===========================================================================
25 *
26 * Author: Aleksey Grichenko
27 *
28 * File Description:
29 * Global query request
30 *
31 */
32 
33 #include <ncbi_pch.hpp>
35 #include <cgi/cgi_util.hpp>
36 
37 
39 
40 
42  : CEUtils_Request(ctx, "egquery.fcgi")
43 {
44 }
45 
46 
48 {
49 }
50 
51 
53 {
54  string args = TParent::GetQueryString();
55  if ( !m_Term.empty() ) {
56  args += "&term=" +
58  }
59  return args;
60 }
61 
62 
64 {
65  return eSerial_Xml;
66 }
67 
68 
70 {
72  _ASSERT(is);
73  CRef<egquery::CResult> res(new egquery::CResult);
74  *is >> *res;
75  Disconnect();
76  return res;
77 }
78 
79 
CObjectIStream –.
Definition: objistr.hpp:92
void Disconnect(void)
Close connection, destroy the stream.
Definition: eutils.hpp:140
CObjectIStream * GetObjectIStream(void)
Get serial stream for reading xml or asn data.
Definition: eutils.cpp:238
virtual ESerialDataFormat GetSerialDataFormat(void) const
Get serial stream format for reading data.
Definition: egquery.cpp:63
static const unsigned char res[3][32]
Definition: ccm.c:389
CEGQuery_Request(CRef< CEUtils_ConnContext > &ctx)
Create EGQuery request for the given database.
Definition: egquery.cpp:41
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:101
virtual string GetQueryString(void) const
Get CGI script query string.
Definition: egquery.cpp:52
ESerialDataFormat
Data file format.
Definition: serialdef.hpp:71
static CS_CONTEXT * ctx
Definition: ct_dynamic.c:24
CRef< egquery::CResult > GetResult(void)
Get search results.
Definition: egquery.cpp:69
Convert all non-alphanum chars, spaces are converted to '+'.
Definition: ncbistr.hpp:3028
#define _ASSERT
virtual ~CEGQuery_Request(void)
Definition: egquery.cpp:47
virtual string GetQueryString(void) const
Get CGI script query string.
Definition: eutils.cpp:180
static string URLEncode(const CTempString str, EUrlEncode flag=eUrlEnc_SkipMarkChars)
URL-encode string.
Definition: ncbistr.cpp:5740
CEUtils_Request.
Definition: eutils.hpp:109
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:98
Modified on Tue May 22 12:44:57 2018 by modify_doxy.py rev. 546573