& GetName(
void)
const;
100EWriteMethod wmethod = eHTTPResponse,
107 voidCopyAttributes(
const CCgiCookie& cookie);
112 voidSetValue (
const string&
str);
113 voidSetDomain (
const string&
str);
114 voidSetPath (
const string&
str);
115 voidSetExpDate(
consttm& exp_date);
116 voidSetExpTime(
const CTime& exp_time);
117 voidSetSecure (
boolsecure);
118 voidSetHttpOnly(
boolhttp_only);
122 const string& GetValue (
void)
const;
123 const string& GetDomain (
void)
const;
124 const string& GetPath (
void)
const;
126 stringGetExpDate(
void)
const;
128 boolGetExpDate(tm* exp_date)
const;
129 boolGetSecure(
void)
const;
130 boolGetHttpOnly(
void)
const;
138 booloperator() (
const TCPtr& c1,
const TCPtr& c2)
const{
145fInvalid_Name = 1<<0,
146fInvalid_Value = 1<<1,
147fInvalid_Any = fInvalid_Name | fInvalid_Value
170 static voidx_CheckField(
const string&
str,
172 const char* banned_symbols,
173 const string* cookie_name =
NULL);
174 static stringx_EncodeCookie(
const string&
str,
197 returncookie.
Write(os);
242EOnBadCookie on_bad_cookie = eOnBadCookie_SkipAndError,
248 bool Empty(
void)
const;
251 voidSetUrlEncodeFlag(
EUrlEncodeencode_flag);
257 const string&
value,
260EOnBadCookie on_bad_cookie = eOnBadCookie_SkipAndError);
264 const string&
value,
265EOnBadCookie on_bad_cookie);
275 voidAdd(
const string&
str,
276EOnBadCookie on_bad_cookie = eOnBadCookie_SkipAndError);
280 const string& domain,
const string& path);
282 const string& domain,
const string& path)
const;
292 const CCgiCookie* Find(
const string& name, TCRange* range=0)
const;
295TCRange GetAll(
void)
const;
307 size_tRemove(
const string& name,
bool destroy=
true);
323 voidSetAllCookiesSecure(
bool value);
327 voidSetAllCookiesHttpOnly(
bool value);
336 staticECheckResult x_CheckField(
const string&
str,
338 const char* banned_symbols,
339EOnBadCookie on_bad_cookie,
340 const string* cookie_name =
NULL);
366 returncookies.
Write(os);
426 unsigned intposition,
const string&
type)
427: m_Value(
value), m_Filename(filename), m_ContentType(
type),
428m_Position(position) { }
431m_Value(
data.m_Value), m_Filename(
data.m_Filename),
432m_ContentType(
data.m_ContentType),
433m_Position(
data.m_Position)
445 unsigned intposition = 0,
450 unsigned intposition = 0,
454: m_Data(e.m_Data) { }
472 if(m_Data->m_Reader.get()) { x_ForceComplete(); }
473 returnm_Data->m_Value;
476{ x_ForceUnique();
returnm_Data->m_Value; }
478{ x_ForceUnique(); m_Data->m_Value = v; }
480{ x_ForceUnique(); m_Data->m_Reader.reset(
r); }
482{ x_ForceUnique(); m_Data->m_Reader.reset(
new CStreamReader(is, own)); }
504 CStringUTF8GetValueAsUTF8(EOnCharsetError on_error =
505eCharsetError_Ignore)
const;
509{
returnm_Data->m_Filename; }
511{ x_ForceUnique();
returnm_Data->m_Filename; }
513{ x_ForceUnique(); m_Data->m_Filename =
f; }
518{
returnm_Data->m_Position; }
520{ x_ForceUnique();
returnm_Data->m_Position; }
522{ x_ForceUnique(); m_Data->m_Position = p; }
526{
returnm_Data->m_ContentType; }
528{ x_ForceUnique();
returnm_Data->m_ContentType; }
530{ x_ForceUnique(); m_Data->m_ContentType =
f; }
532 operator const string&()
const{
returnGetValue(); }
533 operator string&() {
returnSetValue(); }
538 bool empty()
const{
returnGetValue().empty(); }
539 const char*
c_str()
const{
returnGetValue().c_str(); }
540 int compare(
const string& s)
const{
returnGetValue().compare(s); }
541 int compare(
const char* s)
const{
returnGetValue().compare(s); }
543{
returnGetValue().substr(
i,
n); }
545{
returnGetValue().find(s, pos); }
547{
returnGetValue().find(s, pos); }
549{
returnGetValue().find(c, pos); }
551{
returnGetValue().find_first_of(s, pos); }
553{
returnGetValue().find_first_of(s, pos); }
559 return(GetValue() == e2.
GetValue()
567 return!(*
this== v);
572 returnGetValue() == v;
577 return!(*
this== v);
582 returnGetValue() == v;
587 return!(*
this== v);
593 if( !m_Data->ReferencedOnlyOnce() ) {
594 if(m_Data->m_Reader.get()) { x_ForceComplete(); }
595m_Data =
new SData(*m_Data);
599 voidx_ForceComplete()
const;
602 stringx_GetCharset(
void)
const;
654 const string&
value,
655 const string& filename,
656 boolis_index =
false) = 0;
665 voidAddEntry(
const string& name,
666 const string&
value,
667 const string& filename,
668 boolis_index)
override;
706fIndexesNotEntries = (1 << 0),
708fIgnoreQueryString = (1 << 1),
710fOwnEnvironment = (1 << 2),
712fDoNotParseContent = (1 << 3),
714fCaseInsensitiveArgs = (1 << 4),
716fCookies_Unencoded = (1 << 5),
718fCookies_SpaceAsHex = (1 << 6),
720fSaveRequestContent = (1 << 7),
723fIgnorePageHitId = (1 << 8),
725fSkipDiagProperties = (1 << 9),
727fSetDiagProperties = 0,
729fParseInputOnDemand = (1 << 10),
731fSemicolonIsNotArgDelimiter = (1 << 11),
734fDisableTrackingCookie = (1 << 12),
738fIncludePreparsedEntries = (1 << 13),
740fDisableParsingAsIndex = (1 << 14),
747 size_terrbuf_size = 256);
750 const char*
const* argv,
751 const char*
const* envp = 0,
755 size_terrbuf_size = 256);
758 size_terrbuf_size = 256);
764 static const stringGetPropertyName(
ECgiPropprop);
767 const string& GetProperty(
ECgiPropprop)
const;
777 const string& GetRandomProperty(
const string&
key,
boolhttp =
true)
const;
782 size_tGetContentLength(
void)
const;
786 const string& GetContent(
void)
const;
808 const CCgiEntry& GetEntry(
const string& name,
bool* is_found = 0)
const;
823 CCgiEntry* GetPossiblyUnparsedEntry(
const string& name);
826 voidParseRemainingContent(
void);
839eDontCreateIfNotExist,
846 CCgiSession& GetSession(ESessionCreateMode
mode= eCreateIfNotExist)
const;
856 intGetInputFD(
void)
const;
863 voidSetInputStream(
CNcbiIstream* is,
boolown =
false,
intfd = -1);
885 const char*
const* GetClientTrackingEnv(
void)
const;
900 stringGetCGIEntriesStr(
void)
const;
902 boolCalcChecksum(
string& checksum,
string& content)
const;
918 const string& GetRequestMethodName(
void)
const;
920ERequestMethod GetRequestMethod(
void)
const;
961 const string& x_GetPropertyByName(
const string& name)
const;
1069: m_EncodeFlag(
NStr::eUrlEnc_SkipMarkChars),
1072m_AllSecure(
false),
1073m_AllHttpOnly(
false)
1082m_AllSecure(
false),
1083m_AllHttpOnly(
false)
1094m_AllSecure(
false),
1095m_AllHttpOnly(
false)
1097 Add(
str, on_bad_cookie);
1138 if(
m_Data->m_Reader.get()) {
1139 return m_Data->m_Reader.release();
1149 if(
m_Data->m_Reader.get()) {
1164unique_ptr<IReader> reader(
data.m_Reader.release());
Note about the "buf_size" parameter for streams in this API.
@ fOwnReader
Own the underlying reader.
A very basic data-read interface.
container_type::const_iterator const_iterator
container_type::iterator iterator
parent_type::iterator iterator
parent_type::const_iterator const_iterator
bool operator<(const CEquivRange &A, const CEquivRange &B)
bool operator==(const CEquivRange &A, const CEquivRange &B)
bool Empty(const CNcbiOstrstream &src)
static const char * str(char *buf, int n)
@ eNoOwnership
No ownership is assumed.
set< CCgiCookie *, CCgiCookie::PLessCPtr > TSet
SIZE_TYPE find(char c, SIZE_TYPE pos=0) const
void SetFilename(const string &f)
SIZE_TYPE find(const string &s, SIZE_TYPE pos=0) const
int GetInputFD(void) const
Returns file descriptor of input stream, or -1 if unavailable.
const CNcbiEnvironment * m_Env
set of environment variables
CNcbiIstream * GetValueStream()
Get the value as a stream, potentially on the fly â in which case the caller takes ownership of the s...
CCgiEntry(const char *value, const string &filename=kEmptyStr, unsigned int position=0, const string &type=kEmptyStr)
const TCgiIndexes & GetIndexes(void) const
Get a set of indexes(decoded) received from the client.
string x_RetrieveSessionId() const
void SetSecure(bool secure)
pair< TCIter, TCIter > TCRange
TCgiEntries::iterator TCgiEntriesI
TCgiEntries::const_iterator TCgiEntriesCI
static bool x_GetString(string *str, const string &val)
CCgiRequest(const CCgiRequest &)
prohibit default initialization and assignment
int m_InputFD
input file descriptor, if available.
const TCgiEntries & GetEntries(void) const
Get a set of entries(decoded) received from the client.
NStr::EUrlEncode m_EncodeFlag
map< string, string > TCgiProperties
SIZE_TYPE find(const char *s, SIZE_TYPE pos=0) const
unsigned int & SetPosition()
void SetPath(const string &str)
void SetValue(const string &str)
All SetXXX(const string&) methods beneath:
const string & GetName(void) const
The cookie name cannot be changed during its whole timelife.
CCgiCookie * Find(const string &name, const string &domain, const string &path)
Return NULL if cannot find this exact cookie.
const string & GetValue(void) const
All "const string& GetXXX(...)" methods beneath return reference to "NcbiEmptyString" if the requeste...
CCgiEntryReaderContext * m_EntryReaderContext
string & SetContentType()
void x_SetSession(CCgiSession &session)
int compare(const string &s) const
CExtraEntryCollector(void)
SIZE_TYPE find_first_of(const char *s, SIZE_TYPE pos=0) const
EWriteMethod
Whether the cookie is sent as a part of HTTP request or HTTP response.
TCgiIndexes m_Indexes
set of the request ISINDEX-like indexes(already retrieved; cached)
multimap< string, CCgiEntry, PNocase_Conditional > TCgiEntries
void SetExpDate(const tm &exp_date)
TSet::const_iterator TCIter
void SetUrlEncodeFlag(EUrlEncode encode_flag)
pair< TIter, TIter > TRange
void SetValue(IReader *r)
const string & GetValue() const
Get the value as a string, (necessarily) prefetching it all if applicable; the result remains availab...
ECgiProp
Set of "standard" HTTP request properties.
void SetValue(CNcbiIstream &is, EOwnership own=eNoOwnership)
int compare(const char *s) const
CDiagContext_Extra::TExtraArgs m_Args
void x_ForceComplete() const
const CCgiCookies & GetCookies(void) const
Retrieve the request cookies.
CNcbiIstream * m_Input
input stream
void SetTrackingCookie(const string &cookie_value)
Store/retrieve tracking cookie value.
const string & GetContentType() const
May be available for some fields of POSTed forms.
const CNcbiEnvironment & GetEnvironment() const
CNcbiOstream & Write(CNcbiOstream &os, EWriteMethod wmethod=eHTTPResponse, EUrlEncode flag=eUrlEncode_SkipMarkChars) const
Compose and write to output stream "os":
string substr(SIZE_TYPE i=0, SIZE_TYPE n=NPOS) const
bool Remove(CCgiCookie *cookie, bool destroy=true)
Remove "cookie" from this set; deallocate it if "destroy" is true Return FALSE if can not find "cooki...
TCgiEntries m_Entries
set of the request FORM-like entries(already retrieved; cached)
list< string > TCgiIndexes
void Clear(void)
Remove all stored cookies.
CNcbiOstream & Write(CNcbiOstream &os, CCgiCookie::EWriteMethod wmethod=CCgiCookie::eHTTPResponse) const
Printout all cookies into the stream "os".
void SetHttpOnly(bool http_only)
void SetValue(const string &v)
CDiagContext_Extra::TExtraArgs & GetArgs(void)
CCgiCookies(void)
Empty set of cookies.
void ResetInvalid(TInvalidFlag flag)
IReader * GetValueReader()
Get the value via a reader, potentially on the fly â in which case the caller takes ownership of the ...
unique_ptr< CTrackingEnvHolder > m_TrackingEnvHolder
CCgiCookies(const CCgiCookies &)
prohibit default initialization and assignment
const string & GetTrackingCookie(void) const
NCBI_XCGI_EXPORT
Parameter to control error handling of incoming cookies.
const char * c_str() const
CCgiCookie * Add(const string &name, const string &value, const string &domain=kEmptyStr, const string &path=kEmptyStr, EOnBadCookie on_bad_cookie=eOnBadCookie_SkipAndError)
All Add() functions: if the added cookie has the same {name, domain, path} as an already existing one...
const string & GetFilename() const
Only available for certain fields of POSTed forms.
unique_ptr< CNcbiEnvironment > m_OwnEnv
virtual void AddEntry(const string &name, const string &value, const string &filename, bool is_index=false)=0
bool GetHttpOnly(void) const
SData(const string &value, const string &filename, unsigned int position, const string &type)
CCgiCookies m_Cookies
set of the request cookies(already retrieved; cached)
CCgiEntry(const CCgiEntry &e)
string operator+(const CCgiEntry &e, const string &s)
const string & GetPath(void) const
unique_ptr< string > m_Content
Original request content or NULL if fSaveRequestContent is not set.
SIZE_TYPE find_first_of(const string &s, SIZE_TYPE pos=0) const
EOnBadCookie
How to handle badly formed cookies.
static const size_t kContentLengthUnknown
Get content length using value of the property 'eCgi_ContentLength'.
TInvalidFlag m_InvalidFlag
void SetInvalid(TInvalidFlag flag)
~CCgiCookies(void)
Destructor.
CCgiEntry & operator=(const CCgiEntry &e)
TInvalidFlag IsInvalid(void) const
SIZE_TYPE size() const
commonly-requested string:: operations...
bool GetAllCookiesSecure(void) const
bool GetSecure(void) const
virtual ~CEntryCollector_Base(void)
static void x_CheckField(const string &str, EFieldType ftype, const char *banned_symbols, const string *cookie_name=NULL)
bool GetAllCookiesHttpOnly(void) const
ERequestMethod
Standard request methods.
int TFlags
Startup initialization.
void SetContentType(const string &f)
void SetSecure(bool secure)
Set secure connection flag.
const CCgiCookie * TCPtr
Predicate for the cookie comparison.
CNcbiIstream * GetInputStream(void) const
Return pointer to the input stream.
unsigned int GetPosition() const
CGI parameter number â automatic image name parameter is #0, explicit parameters start at #1.
const string & GetDomain(void) const
void SetDomain(const string &str)
unique_ptr< IReader > m_Reader
size_t m_ErrBufSize
Request initialization error buffer size; when initialization code hits unexpected EOF it will try to...
bool Empty(void) const
Return TRUE if this set contains no cookies.
~CExtraEntryCollector(void) override
CCgiEntry(const string &value=kEmptyStr, const string &filename=kEmptyStr, unsigned int position=0, const string &type=kEmptyStr)
CNcbiOstream & operator<<(CNcbiOstream &os, const CCgiCookie &cookie)
EOnCharsetError
Action to perform if the explicit charset is not supported.
EUrlEncode GetUrlEncodeFlag(void) const
@ eCgi_HttpIfModifiedSince
@ eOnBadCookie_StoreAndError
Report error, store bad cookie as-is.
@ eOnBadCookie_ThrowException
Throw exception, ignore bad cookie.
@ eOnBadCookie_SkipAndError
Report error, ignore bad cookie.
@ eOnBadCookie_Skip
Silently ignore bad cookie.
@ eCreateIfNotExist
If Session does not exist the new one will be created.
@ eCharsetError_Ignore
Ignore unknown charset (try to autodetect)
@ eUrlEncode_SkipMarkChars
SDiagMessage::TExtraArgs TExtraArgs
void Write(CObjectOStream &out, TConstObjectPtr object, const CTypeRef &type)
#define NCBI_PARAM_ENUM_DECL_EXPORT(expname, type, section, name)
Same as NCBI_PARAM_ENUM_DECL but with export specifier (e.g.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
bool operator!=(const CNCBI_IPAddr &lhs, unsigned int rhs)
void g_ExtractReaderContents(IReader &reader, string &s)
Append all IReader contents to a given string.
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
IO_PREFIX::istream CNcbiIstream
Portable alias for istream.
NCBI_NS_STD::string::size_type SIZE_TYPE
EUrlEncode
URL-encode flags.
enum ENcbiOwnership EOwnership
Ownership relations between objects.
const struct ncbi::grid::netcache::search::fields::KEY key
const GenericPointer< typename T::ValueType > T2 value
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
Reader-writer based streams.
API to parse user agent strings.
void Serialize(CNcbiOstream &, const CRawScoreVector< Key, Score > &)
Generics These throw an exception; we must implement serialization for each type.
void Deserialize(CNcbiIstream &istr, CRawScoreVector< Key, Score > &)
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