A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/redirect_8cpp_source.html below:

NCBI C++ ToolKit: src/misc/cgi_redirect/redirect.cpp Source File

35 #include <misc/error_codes.hpp> 39 #define NCBI_USE_ERRCODE_X Misc_CgiRedirect 52 <html><head><title><@_TITLE_@></title></head>\n \ 55  <h1><@_HEADER_@></h1>\n \ 56  <h3><@_MESSAGE_@></h3>\n \ 57  <p>This web page has moved. Please, update your bookmarks and links.</p>\n \ 58  <p><a href=\"<@_URL_@>\">Go to the new page</a></p>.\n \ 78  string

template_name = reg.

Get

(

"Main"

,

"Template"

);

79  if

( !template_name.empty() ) {

99  const string

&

value

,

106  while

( (pos = s.find(

"&{"

, pos)) !=

NPOS

) {

107  SIZE_TYPE

pos_end = s.find(

"}"

, pos + 2);

108  if

( pos_end ==

NPOS

) {

111  string

name =

value

.substr(pos + 2, pos_end - pos - 2);

113  if

(ci != old_entries.

end

()) {

114

s.replace(pos, pos_end - pos + 1,

NStr::URLEncode

((ci->second).GetValue()));

116

s.erase(pos, pos_end - pos + 1);

135

}

catch

(exception& e) {

136  ERR_POST_X

(1,

"Failed to remap CGI entries: "

<< e.what());

142  string

base_url = reg.

Get

(

"Main"

,

"BaseUrl"

);

148  if

( (

i

->first).empty() ) {

151  if

( !url.empty() ) {

155  if

( !(

i

->second).empty() ) {

169

}

catch

(exception& e) {

170  ERR_POST_X

(2,

"Failed to compose/send HTML page: "

<< e.what());

186

list<string> remove_entries;

187  string str

= reg.

Get

(

"Entries"

,

"Remove"

);

192

list<string> clear_entries;

193  str

= reg.

Get

(

"Entries"

,

"Clear"

);

198

list<string> add_empty_entries;

199  str

= reg.

Get

(

"Entries"

,

"Add"

);

204

list<string> change_entries;

208

list<string> add_value_entries;

218  bool

is_removed =

false

;

225  _TRACE

(

"Add empty: "

<<

i

->first);

232  _TRACE

(

"Change: "

<<

i

->first);

233  str

= reg.

Get

(

"Change"

,

i

->first);

248  ITERATE

(list<string>,

i

, add_empty_entries) {

255  ITERATE

(list<string>,

i

, add_value_entries) {

258  str

= reg.

Get

(

"Add"

, *

i

);

const_iterator find(const key_type &key) const

const_iterator end() const

iterator insert(const value_type &val)

container_type::value_type value_type

static const char * str(char *buf, int n)

const CNcbiRegistry & GetConfig(void) const

Get the application's cached configuration parameters (read-only).

#define ITERATE(Type, Var, Cont)

ITERATE macro to sequence through container elements.

virtual void Init(void)

This method is called on the CGI application initialization – before starting to process a HTTP reque...

virtual TCgiEntries & RemapEntries(CCgiContext &ctx, TCgiEntries &new_entries)

Remap CGI entries for the redirection.

virtual void Init(void)

This method is called on the CGI application initialization – before starting to process a HTTP reque...

CHTMLPage m_Page

HTML page used to send back the redirect information.

virtual int ProcessRequest(CCgiContext &ctx)

This is the method you should override.

TCgiEntries::const_iterator TCgiEntriesCI

const TCgiEntries & GetEntries(void) const

Get a set of entries(decoded) received from the client.

CNcbiOstream & out(void) const

Get output stream. Throw exception if GetOutput() is NULL.

CNcbiOstream & WriteHeader(void) const

Write HTTP response header to the output stream.

#define ERR_POST_X(err_subcode, message)

Error posting with default error code and given error subcode.

virtual void AddTagMap(const string &name, BaseTagMapper *mapper)

Tag mappers.

void SetTemplateBuffer(const void *template_buffer, size_t size)

virtual CNcbiOstream & Print(CNcbiOstream &out, TMode mode=eHTML)

void SetTemplateFile(const string &template_file)

Set source which contains the template.

virtual const string & Get(const string &section, const string &name, TFlags flags=0) const

Get the parameter value.

virtual void EnumerateEntries(const string &section, list< string > *entries, TFlags flags=fAllLayers) const

Enumerate parameter names for a specified section.

#define END_NCBI_SCOPE

End previously defined NCBI scope.

#define BEGIN_NCBI_SCOPE

Define ncbi namespace.

NCBI_NS_STD::string::size_type SIZE_TYPE

static list< string > & Split(const CTempString str, const CTempString delim, list< string > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL)

Split a string using specified delimiters.

static string URLDecode(const CTempString str, EUrlDecode flag=eUrlDec_All)

URL-decode string.

static string URLEncode(const CTempString str, EUrlEncode flag=eUrlEnc_SkipMarkChars)

URL-encode string.

@ fSplit_MergeDelimiters

Merge adjacent delimiters.

const GenericPointer< typename T::ValueType > T2 value

void s_AssignEntryValue(const string &name, const string &value, TCgiEntries &old_entries, TCgiEntries &new_entries)

const char *const kDefaultRedirectTemplate

bool s_FindEntryName(const string &name, list< string > &lst)

static wxAcceleratorEntry entries[3]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4