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

Go to the SVN repository for this file.

1 /* $Id: espell.cpp 99026 2023-02-06 13:24:20Z 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 * ESpell request
30 *
31 */
32 
33 #include <ncbi_pch.hpp>
35 #include <cgi/cgi_util.hpp>
36 
37 
39 
40 
43  : CEUtils_Request(ctx, "espell.fcgi")
44 {
45  SetDatabase(db);
46 }
47 
48 
50 {
51 }
52 
53 
55 {
56  string args = TParent::GetQueryString();
57  if ( !m_Term.empty() ) {
58  args += "&term=" +
60  }
61  return args;
62 }
63 
64 
66 {
67  return eSerial_Xml;
68 }
69 
70 
72 {
74  _ASSERT(is);
75  CRef<espell::CESpellResult> res(new espell::CESpellResult);
76  *is >> *res;
77  Disconnect();
78  return res;
79 }
80 
81 
CEUtils_Request.
Definition: eutils.hpp:119
CObjectIStream –.
Definition: objistr.hpp:93
CS_CONTEXT * ctx
Definition: t0006.c:12
void SetDatabase(const string &database)
Setting new database disconnects the request.
Definition: eutils.cpp:282
virtual string GetQueryString(void) const
Get CGI script query string.
Definition: eutils.cpp:200
virtual ESerialDataFormat GetSerialDataFormat(void) const
Get serial stream format for reading data.
Definition: espell.cpp:65
CRef< espell::CESpellResult > GetESpellResult(void)
Get search results.
Definition: espell.cpp:71
virtual string GetQueryString(void) const
Get CGI script query string.
Definition: espell.cpp:54
string m_Term
Definition: espell.hpp:81
CObjectIStream * GetObjIStream(void)
Get serial stream for reading xml or asn data.
Definition: eutils.cpp:266
virtual ~CESpell_Request(void)
Definition: espell.cpp:49
CESpell_Request(const string &db, CRef< CEUtils_ConnContext > &ctx)
Create ESpell request for the given database.
Definition: espell.cpp:41
void Disconnect(void)
Close connection, destroy the stream.
Definition: eutils.hpp:149
ESerialDataFormat
Data file format.
Definition: serialdef.hpp:71
@ eSerial_Xml
XML.
Definition: serialdef.hpp:75
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
static string URLEncode(const CTempString str, EUrlEncode flag=eUrlEnc_SkipMarkChars)
URL-encode string.
Definition: ncbistr.cpp:6053
@ eUrlEnc_ProcessMarkChars
Convert all non-alphanumeric chars, spaces are converted to '+'.
Definition: ncbistr.hpp:3145
#define _ASSERT
Modified on Fri Sep 20 14:57:10 2024 by modify_doxy.py rev. 669887