template_name = reg.
Get(
"Main",
"Template");
79 if( !template_name.empty() ) {
99 const string&
value,
106 while( (pos = s.find(
"&{", pos)) !=
NPOS) {
107 SIZE_TYPEpos_end = s.find(
"}", pos + 2);
108 if( pos_end ==
NPOS) {
111 stringname =
value.substr(pos + 2, pos_end - pos - 2);
113 if(ci != old_entries.
end()) {
114s.replace(pos, pos_end - pos + 1,
NStr::URLEncode((ci->second).GetValue()));
116s.erase(pos, pos_end - pos + 1);
135}
catch(exception& e) {
136 ERR_POST_X(1,
"Failed to remap CGI entries: "<< e.what());
142 stringbase_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());
186list<string> remove_entries;
187 string str= reg.
Get(
"Entries",
"Remove");
192list<string> clear_entries;
193 str= reg.
Get(
"Entries",
"Clear");
198list<string> add_empty_entries;
199 str= reg.
Get(
"Entries",
"Add");
204list<string> change_entries;
208list<string> add_value_entries;
218 boolis_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 §ion, const string &name, TFlags flags=0) const
Get the parameter value.
virtual void EnumerateEntries(const string §ion, 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