NCBI C++ ToolKit
Modules | Classes | Typedefs | Enumerations | Enumerator | Functions | Variables
CGI

CGI Members. More...

+ Collaboration diagram for CGI:

Modules

 CGI Base Classes
 @cgi_redirect.hpp Define class CCgiRedirectApplication used to redirect CGI requests.
 
 CGI Command APIs
 
 CGI Exception
 
 CGI Request/Response APIs
 
 Cookie Affinity Services
 

Classes

class  CCgiSession
 CCgiSession –. More...
 
class  ICgiSessionStorage
 ICgiSessionStorage –. More...
 
class  CCgiUserAgent
 CCgiUserAgent –. More...
 

Typedefs

typedef list< stringCCgiSession::TNames
 
typedef CCgiSession::TNames ICgiSessionStorage::TNames
 
typedef CVersionInfo TUserAgentVersion
 User agent version info. More...
 
typedef unsigned int CCgiUserAgent::TFlags
 Binary OR of "EFlags". More...
 
typedef unsigned int CCgiUserAgent::TBotFlags
 Binary OR of "EBotFlags". More...
 
typedef unsigned int CCgiUserAgent::TDeviceFlags
 Binary OR of "EDeviceFlags". More...
 

Enumerations

enum  CCgiSession::EStatus {
  CCgiSession::eNew , CCgiSession::eLoaded , CCgiSession::eNotLoaded , CCgiSession::eDeleted ,
  CCgiSession::eImplNotSet
}
 Session status. More...
 
enum  CCgiSession::ECookieSupport { CCgiSession::eUseCookie , CCgiSession::eNoCookie }
 Specifies if a client session cookie can be used to transfer session id between requests. More...
 
enum  EUrlEncode {
  eUrlEncode_None = NStr::eUrlEnc_None , eUrlEncode_SkipMarkChars = NStr::eUrlEnc_SkipMarkChars , eUrlEncode_ProcessMarkChars = NStr::eUrlEnc_ProcessMarkChars , eUrlEncode_PercentOnly = NStr::eUrlEnc_PercentOnly ,
  eUrlEncode_Path = NStr::eUrlEnc_Path
}
 
enum  EUrlDecode { eUrlDecode_All = NStr::eUrlDec_All , eUrlDecode_Percent = NStr::eUrlDec_Percent }
 
enum  CCgiUserAgent::EFlags { CCgiUserAgent::fNoCase = (1 << 1) , CCgiUserAgent::fUseBotPatterns = (1 << 2) , CCgiUserAgent::fUseDevicePatterns = (1 << 3) }
 Comparison and parsing flags. More...
 
enum  CCgiUserAgent::EBrowser {
  CCgiUserAgent::eUnknown = 0 , CCgiUserAgent::eIE , CCgiUserAgent::eEdge , CCgiUserAgent::eiCab ,
  CCgiUserAgent::eLynx , CCgiUserAgent::eNetscape , CCgiUserAgent::eOpera , CCgiUserAgent::eOregano ,
  CCgiUserAgent::ePapers , CCgiUserAgent::eUCBrowser , CCgiUserAgent::eW3m , CCgiUserAgent::eNagios ,
  CCgiUserAgent::eBeonex , CCgiUserAgent::eCamino , CCgiUserAgent::eChimera , CCgiUserAgent::eFirefox ,
  CCgiUserAgent::eFlock , CCgiUserAgent::eIceCat , CCgiUserAgent::eIceweasel , CCgiUserAgent::eGaleon ,
  CCgiUserAgent::eGranParadiso , CCgiUserAgent::eKazehakase , CCgiUserAgent::eKMeleon , CCgiUserAgent::eKNinja ,
  CCgiUserAgent::eMadfox , CCgiUserAgent::eMultiZilla , CCgiUserAgent::eSeaMonkey , CCgiUserAgent::eAcooBrowser ,
  CCgiUserAgent::eAOL , CCgiUserAgent::eAvantBrowser , CCgiUserAgent::eCrazyBrowser , CCgiUserAgent::eEnigmaBrowser ,
  CCgiUserAgent::eIRider , CCgiUserAgent::eMaxthon , CCgiUserAgent::eNetCaptor , CCgiUserAgent::eChrome ,
  CCgiUserAgent::eFluid , CCgiUserAgent::eKonqueror , CCgiUserAgent::eMidori , CCgiUserAgent::eNetNewsWire ,
  CCgiUserAgent::eOmniWeb , CCgiUserAgent::eQtWeb , CCgiUserAgent::eSafari , CCgiUserAgent::eShiira ,
  CCgiUserAgent::eStainless , CCgiUserAgent::eCrawler , CCgiUserAgent::eOfflineBrowser , CCgiUserAgent::eScript ,
  CCgiUserAgent::eLinkChecker , CCgiUserAgent::eWebValidator , CCgiUserAgent::eAirEdge , CCgiUserAgent::eAvantGo ,
  CCgiUserAgent::eBlackberry , CCgiUserAgent::eDoCoMo , CCgiUserAgent::eEudoraWeb , CCgiUserAgent::eMinimo ,
  CCgiUserAgent::eNetFront , CCgiUserAgent::eOperaMini , CCgiUserAgent::eOperaMobile , CCgiUserAgent::eOpenWave ,
  CCgiUserAgent::ePIE , CCgiUserAgent::ePlucker , CCgiUserAgent::ePocketLink , CCgiUserAgent::ePolaris ,
  CCgiUserAgent::eReqwireless , CCgiUserAgent::eSafariMobile , CCgiUserAgent::eSEMCBrowser , CCgiUserAgent::eTelecaObigo ,
  CCgiUserAgent::euZardWeb , CCgiUserAgent::eVodafone , CCgiUserAgent::eXiino , CCgiUserAgent::eMozilla ,
  CCgiUserAgent::eMozillaCompatible
}
 Browser types. More...
 
enum  CCgiUserAgent::EBrowserEngine {
  CCgiUserAgent::eEngine_Unknown = eUnknown , CCgiUserAgent::eEngine_IE = eIE , CCgiUserAgent::eEngine_Edge = eEdge , CCgiUserAgent::eEngine_Gecko = eMozilla ,
  CCgiUserAgent::eEngine_KHTML = eKonqueror , CCgiUserAgent::eEngine_WebKit = eSafari , CCgiUserAgent::eEngine_Blink = eChrome , CCgiUserAgent::eEngine_Bot = eCrawler
}
 Browser engine types. More...
 
enum  CCgiUserAgent::EBrowserPlatform {
  CCgiUserAgent::ePlatform_Unknown = eUnknown , CCgiUserAgent::ePlatform_Windows , CCgiUserAgent::ePlatform_Mac , CCgiUserAgent::ePlatform_Unix ,
  CCgiUserAgent::ePlatform_Android , CCgiUserAgent::ePlatform_Palm , CCgiUserAgent::ePlatform_Symbian , CCgiUserAgent::ePlatform_WindowsCE ,
  CCgiUserAgent::ePlatform_MobileDevice
}
 Platform types. More...
 
enum  CCgiUserAgent::EBotFlags {
  CCgiUserAgent::fBotCrawler = (1<<1) , CCgiUserAgent::fBotOfflineBrowser = (1<<2) , CCgiUserAgent::fBotScript = (1<<3) , CCgiUserAgent::fBotLinkChecker = (1<<4) ,
  CCgiUserAgent::fBotWebValidator = (1<<5) , CCgiUserAgent::fBotAll = 0xFF
}
 Bots check flags (what consider to be a bot). More...
 
enum  CCgiUserAgent::EDeviceFlags { CCgiUserAgent::fDevice_Phone = (1<<1) , CCgiUserAgent::fDevice_Tablet = (1<<2) , CCgiUserAgent::fDevice_Mobile = fDevice_Phone | fDevice_Tablet }
 Flags to check device type. More...
 

Functions

 CCgiSession::CCgiSession (const CCgiRequest &request, ICgiSessionStorage *impl, EOwnership impl_ownership=eTakeOwnership, ECookieSupport cookie_support=eUseCookie)
 
 CCgiSession::~CCgiSession ()
 
const stringCCgiSession::GetId (void) const
 Get session ID. More...
 
void CCgiSession::SetId (const string &session_id)
 Set session ID. More...
 
void CCgiSession::ModifyId (const string &new_session_id)
 Modify session ID. More...
 
void CCgiSession::Load (void)
 Load the session. More...
 
void CCgiSession::CreateNewSession (void)
 Create new session. More...
 
TNames CCgiSession::GetAttributeNames (void) const
 Retrieve names of all attributes attached to this session. More...
 
CNcbiIstreamCCgiSession::GetAttrIStream (const string &name, size_t *size=NULL)
 Get input stream to read an attribute's data from. More...
 
CNcbiOstreamCCgiSession::GetAttrOStream (const string &name)
 Get output stream to write an attribute's data to. More...
 
void CCgiSession::SetAttribute (const string &name, const string &value)
 Set attribute data as a string. More...
 
string CCgiSession::GetAttribute (const string &name) const
 Get attribute data as string. More...
 
void CCgiSession::RemoveAttribute (const string &name)
 Remove attribute from the session. More...
 
void CCgiSession::DeleteSession (void)
 Delete current session. More...
 
EStatus CCgiSession::GetStatus (void) const
 Get current status of the session. More...
 
bool CCgiSession::Exists (void) const
 Check if this session object is valid. More...
 
const stringCCgiSession::GetSessionIdName (void) const
 Get name for session ID. More...
 
void CCgiSession::SetSessionIdName (const string &name)
 Set name for session ID. More...
 
void CCgiSession::SetSessionCookieDomain (const string &domain)
 Set session cookie domain. More...
 
void CCgiSession::SetSessionCookiePath (const string &path)
 Set session cookie path. More...
 
void CCgiSession::SetSessionCookieExpTime (const CTime &exp_time)
 Set session cookie expiration time. More...
 
const CCgiCookieCCgiSession::GetSessionCookie (void) const
 Get a cookie pertaining to the session. More...
 
string CCgiSession::RetrieveSessionId () const
 Retrieve a session id from a query string or a session cookie. More...
 
void CCgiSession::x_Load () const
 
 CCgiSession::CCgiSession (const CCgiSession &)
 
CCgiSessionCCgiSession::operator= (const CCgiSession &)
 
virtual ICgiSessionStorage::~ICgiSessionStorage ()
 
virtual string ICgiSessionStorage::CreateNewSession ()=0
 Create a new empty session. More...
 
virtual void ICgiSessionStorage::ModifySessionId (const string &new_id)=0
 Modify session id. More...
 
virtual bool ICgiSessionStorage::LoadSession (const string &sessionid)=0
 Load the session The implementations must handle binary data correctly (e.g. More...
 
virtual TNames ICgiSessionStorage::GetAttributeNames (void) const =0
 Retrieve names of all attributes attached to this session. More...
 
virtual CNcbiIstreamICgiSessionStorage::GetAttrIStream (const string &name, size_t *size=0)=0
 Get input stream to read an attribute's data from. More...
 
virtual CNcbiOstreamICgiSessionStorage::GetAttrOStream (const string &name)=0
 Get output stream to write an attribute's data to. More...
 
virtual void ICgiSessionStorage::SetAttribute (const string &name, const string &value)=0
 Set attribute data as a string. More...
 
virtual string ICgiSessionStorage::GetAttribute (const string &name) const =0
 Get attribute data as string. More...
 
virtual void ICgiSessionStorage::RemoveAttribute (const string &name)=0
 Remove attribute from the session. More...
 
virtual void ICgiSessionStorage::DeleteSession ()=0
 Delete current session. More...
 
virtual void ICgiSessionStorage::Reset ()=0
 Reset the session. More...
 
string URL_DecodeString (const string &str, EUrlEncode encode_flag=eUrlEncode_SkipMarkChars)
 
SIZE_TYPE URL_DecodeInPlace (string &str, EUrlDecode decode_flag=eUrlDecode_All)
 
string URL_EncodeString (const string &str, EUrlEncode encode_flag=eUrlEncode_SkipMarkChars)
 
void SetQueryString (const string &query, const IUrlEncoder *encoder=0)
 
string GetQueryString (EAmpEncoding amp_enc, EUrlEncode encode) const
 
 CCgiUserAgent::CCgiUserAgent (TFlags flags=0)
 Default constructor. More...
 
 CCgiUserAgent::CCgiUserAgent (const string &user_agent, TFlags flags=0)
 Constructor. More...
 
void CCgiUserAgent::Reset (const string &user_agent)
 Parse new user agent string. More...
 
string CCgiUserAgent::GetUserAgentStr (void) const
 Get user agent string. More...
 
EBrowser CCgiUserAgent::GetBrowser (void) const
 Get browser type. More...
 
const stringCCgiUserAgent::GetBrowserName (void) const
 Get browser name. More...
 
EBrowserEngine CCgiUserAgent::GetEngine (void) const
 Get browser engine type and name. More...
 
string CCgiUserAgent::GetEngineName (void) const
 
EBrowserPlatform CCgiUserAgent::GetPlatform (void) const
 Get platform (OS) type and name. More...
 
string CCgiUserAgent::GetPlatformName (void) const
 
const TUserAgentVersionCCgiUserAgent::GetBrowserVersion (void) const
 Get browser version information. More...
 
const TUserAgentVersionCCgiUserAgent::GetEngineVersion (void) const
 
const TUserAgentVersionCCgiUserAgent::GetMozillaVersion (void) const
 
bool CCgiUserAgent::IsBrowser (void) const
 Check that this is known browser. More...
 
bool CCgiUserAgent::IsBot (TBotFlags flags=fBotAll, const string &include_patterns=kEmptyStr, const string &exclude_patterns=kEmptyStr) const
 Check that this is known search robot/bot. More...
 
TDeviceFlags CCgiUserAgent::GetDeviceType (void) const
 Get device type. More...
 
bool CCgiUserAgent::IsPhoneDevice (const string &include_patterns=kEmptyStr, const string &exclude_patterns=kEmptyStr) const
 Check that this is a known phone-size device. More...
 
bool CCgiUserAgent::IsTabletDevice (const string &include_patterns=kEmptyStr, const string &exclude_patterns=kEmptyStr) const
 Check that this is a known tablet device. More...
 
bool CCgiUserAgent::IsMobileDevice (const string &include_patterns=kEmptyStr, const string &exclude_patterns=kEmptyStr) const
 Check that this is a known mobile device. More...
 
void CCgiUserAgent::x_Init (void)
 Init class members. More...
 
void CCgiUserAgent::x_Parse (const string &user_agent)
 Parse user agent string. More...
 
bool CCgiUserAgent::x_ParseToken (const string &token, int where, EBrowserEngine engine=eEngine_Unknown)
 Parse token with browser name and version. More...
 
bool CCgiUserAgent::x_CheckPattern (int what, bool current_status, bool use_patterns, const string &include_patterns=kEmptyStr, const string &exclude_patterns=kEmptyStr) const
 Helper method to check UA-string against external pattern lists. More...
 

Variables

static const char * CCgiSession::kDefaultSessionIdName = "ncbi_session_data"
 
static const char * CCgiSession::kDefaultSessionCookieDomain = ".nih.gov"
 
static const char * CCgiSession::kDefaultSessionCookiePath = "/"
 
const CCgiRequestCCgiSession::m_Request
 
ICgiSessionStorageCCgiSession::m_Impl
 
unique_ptr< ICgiSessionStorageCCgiSession::m_ImplGuard
 
ECookieSupport CCgiSession::m_CookieSupport
 
string CCgiSession::m_SessionId
 
string CCgiSession::m_SessionIdName
 
string CCgiSession::m_SessionCookieDomain
 
string CCgiSession::m_SessionCookiePath
 
CTime CCgiSession::m_SessionCookieExpTime
 
unique_ptr< CCgiCookieCCgiSession::m_SessionCookie
 
EStatus CCgiSession::m_Status
 
NCBI_DEPRECATED_CLASS NCBI_XCGI_EXPORT CCgiArgs_Parser
 
NCBI_DEPRECATED_CLASS NCBI_XCGI_EXPORT EUrlEncode encode { CUrlArgs_Parser::SetQueryString(query, NStr::EUrlEncode(encode))
 
NCBI_DEPRECATED_CLASS NCBI_XCGI_EXPORT CCgiArgs
 
NCBI_DEPRECATED_CLASS NCBI_XCGI_EXPORT EUrlEncode decode
 
string CCgiUserAgent::m_UserAgent
 User-Agent string. More...
 
TFlags CCgiUserAgent::m_Flags
 Comparison and parsing flags. More...
 
EBrowser CCgiUserAgent::m_Browser
 Browser type. More...
 
string CCgiUserAgent::m_BrowserName
 Browser name. More...
 
TUserAgentVersion CCgiUserAgent::m_BrowserVersion
 Browser version info. More...
 
EBrowserEngine CCgiUserAgent::m_Engine
 Browser engine type. More...
 
TUserAgentVersion CCgiUserAgent::m_EngineVersion
 Browser engine version. More...
 
TUserAgentVersion CCgiUserAgent::m_MozillaVersion
 Browser mozilla version. More...
 
EBrowserPlatform CCgiUserAgent::m_Platform
 Platform type. More...
 
TDeviceFlags CCgiUserAgent::m_DeviceFlags
 Device type flags. More...
 

Detailed Description

CGI Members.

Typedef Documentation

◆ TBotFlags

typedef unsigned int CCgiUserAgent::TBotFlags

Binary OR of "EBotFlags".

Definition at line 267 of file user_agent.hpp.

◆ TDeviceFlags

typedef unsigned int CCgiUserAgent::TDeviceFlags

Binary OR of "EDeviceFlags".

Definition at line 322 of file user_agent.hpp.

◆ TFlags

typedef unsigned int CCgiUserAgent::TFlags

Binary OR of "EFlags".

Definition at line 72 of file user_agent.hpp.

◆ TNames [1/2]

typedef list<string> CCgiSession::TNames

Definition at line 64 of file cgi_session.hpp.

◆ TNames [2/2]

Definition at line 250 of file cgi_session.hpp.

◆ TUserAgentVersion

User agent version info.

Definition at line 48 of file user_agent.hpp.

Enumeration Type Documentation

◆ EBotFlags

Bots check flags (what consider to be a bot).

See also
EBrowser, EBrowserEngine
Enumerator
fBotCrawler 
fBotOfflineBrowser 
fBotScript 
fBotLinkChecker 
fBotWebValidator 
fBotAll 

Definition at line 259 of file user_agent.hpp.

◆ EBrowser

Browser types.

Enumerator
eUnknown 

Unknown user agent.

eIE 

Microsoft Internet Explorer (www.microsoft.com/windows/ie)

eEdge 

Microsoft Edge (www.microsoft.com)

eiCab 

iCab (www.icab.de)

eLynx 

Lynx (lynx.browser.org)

eNetscape 

Netscape (Navigator), versions >=6 are Gecko-based (www.netscape.com)

eOpera 

Opera (www.opera.com)

eOregano 

Oregano (www.castle.org.uk/oregano)

ePapers 

Papers (papersapp.com)

eUCBrowser 

UC Browser (www.ucweb.com/ucbrowser)

eW3m 

w3m (www.w3m.org)

eNagios 

check_http/nagios-plugins (nagiosplugins.org)

eBeonex 

Beonex Communicator (www.beonex.com)

eCamino 

Camino (www.caminobrowser.org)

eChimera 

Chimera (chimera.mozdev.org)

eFirefox 

Firefox (www.mozilla.org/products/firefox)

eFlock 

Flock (www.flock.com)

eIceCat 

GNU IceCat (http://www.gnu.org/software/gnuzilla)

eIceweasel 

Debian Iceweasel (www.geticeweasel.org)

eGaleon 

Galeon (galeon.sourceforge.net)

eGranParadiso 

GranParadiso (www.mozilla.org)

eKazehakase 

Kazehakase (kazehakase.sourceforge.jp)

eKMeleon 

K-Meleon (kmeleon.sf.net)

eKNinja 

K-Ninja Samurai (k-ninja-samurai.en.softonic.com)

eMadfox 

Madfox (www.splyb.com/madfox)

eMultiZilla 

MultiZilla (multizilla.mozdev.org)

eSeaMonkey 

SeaMonkey (www.mozilla.org/projects/seamonkey)

eAcooBrowser 

Acoo Browser (www.acoobrowser.com)

eAOL 

America Online Browser (www.aol.com)

eAvantBrowser 

Avant Browser (www.avantbrowser.com)

eCrazyBrowser 

Crazy Browser (www.crazybrowser.com)

eEnigmaBrowser 

Enigma Browser (www.suttondesigns.com)

eIRider 

iRider (www.irider.com)

eMaxthon 

Maxthon/MyIE2 (www.maxthon.com)

eNetCaptor 

NetCaptor (www.netcaptor.com)

eChrome 

Google Chrome (www.google.com/chrome)

eFluid 

Fluid (fluidapp.com)

eKonqueror 

Konqueror (www.konqueror.org) (KHTML based since v3.2 ?)

eMidori 

Midori.

eNetNewsWire 

NetNewsWire (www.apple.com)

eOmniWeb 

OmniWeb (www.omnigroup.com/applications/omniweb)

eQtWeb 

QtWeb (www.qtweb.net)

eSafari 

Safari (www.apple.com/safari)

eShiira 

Shiira (hmdt-web.net/shiira/en)

eStainless 

Stainless (www.stainlessapp.com)

eCrawler 

Search robots/bots/validators.

Class: crawlers / search robots

eOfflineBrowser 

Class: offline browsers.

eScript 

Class: script tools (perl/php/...)

eLinkChecker 

Class: link checkers.

eWebValidator 

Class: validators.

eAirEdge 

Mobile devices (browsers and services for: telephones, smartphones, tablets and etc) Some mobile devices use standard browsers, like Opera or Safari – see browser platform, if you need a check on mobile device.

AIR-EDGE (www.willcom-inc.com/en/)

eAvantGo 

AvantGo (www.sybase.com/avantgo)

eBlackberry 

Blackberry (www.blackberry.com)

eDoCoMo 

DoCoMo (www.nttdocomo.com)

eEudoraWeb 

EudoraWeb (www.eudora.com)

eMinimo 

Minimo (www.mozilla.org/projects/minimo)

eNetFront 

NetFront (www.access-company.com)

eOperaMini 

Opera Mini (www.opera.com/mini)

eOperaMobile 

Opera Mobile (www.opera.com/mobile)

eOpenWave 

OpenWave/UP.Browser (www.openwave.com)

ePIE 

Pocket IE (www.reensoft.com/PIEPlus)

ePlucker 

Plucker (www.plkr.org)

ePocketLink 

PocketLink (www.mobilefan.net)

ePolaris 

Polaris Browser (www.infraware.co.kr)

eReqwireless 

Reqwireless Webviewer.

eSafariMobile 

Mobile Safari (www.apple.com/safari)

eSEMCBrowser 

Sony Ericsson SEMC-Browser (www.sonyericsson.com)

eTelecaObigo 

Teleca/Obigo (www.teleca.com / www.obigo.com)

euZardWeb 

uZard Web (www.uzard.com)

eVodafone 

Ex J-Phone, now Vodafone Live! (www.vodafone.com)

eXiino 

Xiino (www.ilinx.co.jp/en/)

eMozilla 

Any other Gecko-based not from the list above, Mozilla version >= 5.0.

Mozilla/other Gecko-based (www.mozilla.com)

eMozillaCompatible 

Any other not from list above.

User agent string starts with "Mozilla/x.x (compatible;*". Not Gecko-based. Mozilla-compatible

Definition at line 91 of file user_agent.hpp.

◆ EBrowserEngine

Browser engine types.

Enumerator
eEngine_Unknown 

Unknown engine.

eEngine_IE 

Microsoft Internet Explorer (Trident and etc)

eEngine_Edge 

Microsoft Edge.

eEngine_Gecko 

Gecko-based.

eEngine_KHTML 

KHTML-based.

eEngine_WebKit 

Apple WebKit (KHTML fork)

eEngine_Blink 

Google Blink (WebKit/537.36 fork)

eEngine_Bot 

Search robot/bot/checker/...

Definition at line 191 of file user_agent.hpp.

◆ EBrowserPlatform

Platform types.

Enumerator
ePlatform_Unknown 

Unknown OS.

ePlatform_Windows 

Microsoft Windows.

ePlatform_Mac 

MacOS.

ePlatform_Unix 

Unix.

ePlatform_Android 

Android.

ePlatform_Palm 

PalmOS.

ePlatform_Symbian 

SymbianOS.

ePlatform_WindowsCE 

Microsoft Windows CE (+ Windows Mobile)

ePlatform_MobileDevice 

Other mobile devices or services.

Definition at line 203 of file user_agent.hpp.

◆ ECookieSupport

Specifies if a client session cookie can be used to transfer session id between requests.

Enumerator
eUseCookie 

A session cookie will be added to the response.

eNoCookie 

A session cookie will not be added to the response.

Definition at line 82 of file cgi_session.hpp.

◆ EDeviceFlags

Flags to check device type.

Zero value mean unknown device type, usually considered as desktop.

See also
GetDeviceType, IsMobileDevice, IsTableDevice
Enumerator
fDevice_Phone 

Phone / not known tablet / mobile browser on desktop.

fDevice_Tablet 

Known tablet.

fDevice_Mobile 

Definition at line 317 of file user_agent.hpp.

◆ EFlags

Comparison and parsing flags.

Enumerator
fNoCase 

Case insensitive compare, by default it is case sensitive.

fUseBotPatterns 

Use external pattern list from registry/environment to check on bots, off by default.

fUseDevicePatterns 

Use external pattern lists from registry/environment to check on phone/tablet/mobile device when parsing, off by default.

Definition at line 62 of file user_agent.hpp.

◆ EStatus

Session status.

Enumerator
eNew 

The session has just been created.

eLoaded 

The session is loaded.

eNotLoaded 

The session has not been loaded yet.

eDeleted 

The session is deleted.

eImplNotSet 

The CGI application didn't set the session implementation.

Definition at line 71 of file cgi_session.hpp.

◆ EUrlDecode

enum EUrlDecode
Deprecated:
Use NStr::EUrlDecode
Enumerator
eUrlDecode_All 
eUrlDecode_Percent 

Definition at line 65 of file cgi_util.hpp.

◆ EUrlEncode

enum EUrlEncode
Deprecated:
Use NStr::EUrlEncode
Enumerator
eUrlEncode_None 
eUrlEncode_SkipMarkChars 
eUrlEncode_ProcessMarkChars 
eUrlEncode_PercentOnly 
eUrlEncode_Path 

Definition at line 56 of file cgi_util.hpp.

Function Documentation

◆ CCgiSession() [1/2]

CCgiSession::CCgiSession ( const CCgiRequest request,
ICgiSessionStorage impl,
EOwnership  impl_ownership = eTakeOwnership,
ECookieSupport  cookie_support = eUseCookie 
)

◆ CCgiSession() [2/2]

CCgiSession::CCgiSession ( const CCgiSession )
private

◆ CCgiUserAgent() [1/2]

CCgiUserAgent::CCgiUserAgent ( const string user_agent,
TFlags  flags = 0 
)

Constructor.

Parse the user agent string passed into the constructor.

Note
Some registry/environment parameters can affect user agent parsing. All such features are off by default for better performance, see EFlags. But they will be used regardless of specified flags in IsBot/IsMobileDevice/IsTabletDevice methods.

Definition at line 81 of file user_agent.cpp.

References flags, CCgiUserAgent::m_Flags, and CCgiUserAgent::x_Parse().

◆ CCgiUserAgent() [2/2]

CCgiUserAgent::CCgiUserAgent ( TFlags  flags = 0)

◆ CreateNewSession() [1/2]

virtual string ICgiSessionStorage::CreateNewSession ( )
pure virtual

Create a new empty session.

Returns
ID of the new session

Implemented in CCgiSession_NetCache.

Referenced by CCgiSession::CreateNewSession().

◆ CreateNewSession() [2/2]

void CCgiSession::CreateNewSession ( void  )

◆ DeleteSession() [1/2]

virtual void ICgiSessionStorage::DeleteSession ( )
pure virtual

Delete current session.

Implemented in CCgiSession_NetCache.

Referenced by CCgiSession::DeleteSession().

◆ DeleteSession() [2/2]

void CCgiSession::DeleteSession ( void  )

◆ Exists()

bool CCgiSession::Exists ( void  ) const
inline

Check if this session object is valid.

Returns
True, if this session has been successfully loaded or has just been created. False - if this session does not exist and cannot be used.

Definition at line 232 of file cgi_session.hpp.

References CCgiSession::eLoaded, CCgiSession::eNew, and CCgiSession::m_Status.

Referenced by CCgiSession::CreateNewSession(), CCgiRequest::GetSession(), CCgiSession::GetSessionCookie(), CCgiSession::Load(), CCgiSession::ModifyId(), CCgiSession::SetId(), and CCgiSession::~CCgiSession().

◆ GetAttribute() [1/2]

string CCgiSession::GetAttribute ( const string name) const

Get attribute data as string.

Parameters
[in]nameName of the attribute to retrieve
Returns
Data of the attribute, if set.
Exceptions
CCgiSessionExceptionwith error code eNotLoaded if the session has not been loaded yet; CCgiSessionException with error code eAttrNotFound if attribute with the specified name was not found; CCgiSessionException with error code eImplException if an error occured during attribute retrieval – in the latter case, more information can be obtained from the embedded exception.

Definition at line 166 of file cgi_session.cpp.

References ICgiSessionStorage::GetAttribute(), CCgiSession::m_Impl, and CCgiSession::x_Load().

Referenced by CCgiSessionSampleApplication::ProcessRequest().

◆ GetAttribute() [2/2]

virtual string ICgiSessionStorage::GetAttribute ( const string name) const
pure virtual

Get attribute data as string.

Parameters
[in]nameName of the attribute to retrieve
Returns
Data of the attribute, if set.
Exceptions
CCgiSessionExceptionwith error code eNotLoaded if the session has not been loaded yet; CCgiSessionException with error code eAttrNotFound if attribute with the specified name was not found; CCgiSessionException with error code eImplException if an error occured during attribute retrieval – in the latter case, more information can be obtained from the embedded exception.

Implemented in CCgiSession_NetCache.

Referenced by CCgiSession::GetAttribute().

◆ GetAttributeNames() [1/2]

CCgiSession::TNames CCgiSession::GetAttributeNames ( void  ) const

Retrieve names of all attributes attached to this session.

Exceptions
CCgiSessionExceptionif the session is not loaded.

Definition at line 141 of file cgi_session.cpp.

References ICgiSessionStorage::GetAttributeNames(), CCgiSession::m_Impl, and CCgiSession::x_Load().

Referenced by CCgiSessionSampleApplication::ProcessRequest().

◆ GetAttributeNames() [2/2]

virtual TNames ICgiSessionStorage::GetAttributeNames ( void  ) const
pure virtual

Retrieve names of all attributes attached to this session.

Implemented in CCgiSession_NetCache.

Referenced by CCgiSession::GetAttributeNames().

◆ GetAttrIStream() [1/2]

virtual CNcbiIstream& ICgiSessionStorage::GetAttrIStream ( const string name,
size_t *  size = 0 
)
pure virtual

Get input stream to read an attribute's data from.

Parameters
[in]nameName of the attribute
[out]sizeSize of the attribute's data
Returns
Stream to read attribute's data from.If the attribute does not exist, then return an empty stream.

Implemented in CCgiSession_NetCache.

Referenced by CCgiSession::GetAttrIStream().

◆ GetAttrIStream() [2/2]

CNcbiIstream & CCgiSession::GetAttrIStream ( const string name,
size_t *  size = NULL 
)

Get input stream to read an attribute's data from.

Parameters
[in]nameName of the attribute
[out]sizeSize of the attribute's data
Returns
Stream to read attribute's data from.If the attribute does not exist, then return an empty stream.
Exceptions
CCgiSessionExceptionif the session is not loaded.

Definition at line 147 of file cgi_session.cpp.

References ICgiSessionStorage::GetAttrIStream(), CCgiSession::Load(), CCgiSession::m_Impl, and ncbi::grid::netcache::search::fields::size.

◆ GetAttrOStream() [1/2]

CNcbiOstream & CCgiSession::GetAttrOStream ( const string name)

Get output stream to write an attribute's data to.

If the attribute does not exist it will be created and added to the session. If the attribute exists its content will be overwritten.

Parameters
[in]nameName of the attribute
Exceptions
CCgiSessionExceptionif the session is not loaded.

Definition at line 154 of file cgi_session.cpp.

References ICgiSessionStorage::GetAttrOStream(), CCgiSession::Load(), and CCgiSession::m_Impl.

Referenced by CCgiSessionSampleApplication::ProcessRequest().

◆ GetAttrOStream() [2/2]

virtual CNcbiOstream& ICgiSessionStorage::GetAttrOStream ( const string name)
pure virtual

Get output stream to write an attribute's data to.

If the attribute does not exist it will be created and added to the session. If the attribute exists its content will be overwritten.

Parameters
[in]nameName of the attribute

Implemented in CCgiSession_NetCache.

Referenced by CCgiSession::GetAttrOStream().

◆ GetBrowser()

EBrowser CCgiUserAgent::GetBrowser ( void  ) const
inline

Get browser type.

Definition at line 222 of file user_agent.hpp.

References CCgiUserAgent::m_Browser.

Referenced by CCgiUserAgent::IsBot(), CCgiUserAgent::IsBrowser(), and CCgiUserAgent::x_CheckPattern().

◆ GetBrowserName()

const string& CCgiUserAgent::GetBrowserName ( void  ) const
inline

Get browser name.

Returns
Browser name or empty string for unknown browser
See also
GetBrowser

Definition at line 230 of file user_agent.hpp.

References CCgiUserAgent::m_BrowserName.

◆ GetBrowserVersion()

const TUserAgentVersion& CCgiUserAgent::GetBrowserVersion ( void  ) const
inline

Get browser version information.

If version field (major, minor, patch level) equal -1 that it is not defined.

Definition at line 249 of file user_agent.hpp.

References CCgiUserAgent::m_BrowserVersion.

◆ GetDeviceType()

TDeviceFlags CCgiUserAgent::GetDeviceType ( void  ) const
inline

Get device type.

Use this method with caution, because it is impossible to detect resolution or form-factor of the device based on user agent string only. We can only make an assumptions here.

Returns
Bit mask with categories of devices that can have such user agent string. Zero value mean unknown device type, usually considered as desktop.
Note
Some registry/environment parameters can affect user agent parsing. See IsPhoneDevice(), IsMobileDevice() and IsTabletDevice() for details.
See also
IsMobileDevice, IsTableDevice

Definition at line 336 of file user_agent.hpp.

References CCgiUserAgent::m_DeviceFlags.

◆ GetEngine()

EBrowserEngine CCgiUserAgent::GetEngine ( void  ) const
inline

Get browser engine type and name.

See also
EBrowserEngine

Definition at line 235 of file user_agent.hpp.

References CCgiUserAgent::m_Engine.

Referenced by CCgiUserAgent::GetEngineName(), CCgiUserAgent::IsBot(), and CCgiUserAgent::IsBrowser().

◆ GetEngineName()

string CCgiUserAgent::GetEngineName ( void  ) const

◆ GetEngineVersion()

const TUserAgentVersion& CCgiUserAgent::GetEngineVersion ( void  ) const
inline

Definition at line 251 of file user_agent.hpp.

References CCgiUserAgent::m_EngineVersion.

◆ GetId()

const string & CCgiSession::GetId ( void  ) const

Get session ID.

Exceptions
CCgiSessionExceptionif session ID is not set and it can not be retrieved from CGI request too.

Definition at line 73 of file cgi_session.cpp.

References CCgiSession::m_SessionId, NCBI_THROW, and CCgiSession::RetrieveSessionId().

Referenced by CCgiSession::Load(), and CCgiSessionSampleApplication::ProcessRequest().

◆ GetMozillaVersion()

const TUserAgentVersion& CCgiUserAgent::GetMozillaVersion ( void  ) const
inline

Definition at line 253 of file user_agent.hpp.

References CCgiUserAgent::m_MozillaVersion.

◆ GetPlatform()

EBrowserPlatform CCgiUserAgent::GetPlatform ( void  ) const
inline

Get platform (OS) type and name.

See also
EPlatform

Definition at line 241 of file user_agent.hpp.

References CCgiUserAgent::m_Platform.

Referenced by CCgiUserAgent::GetPlatformName(), and CCgiUserAgent::x_CheckPattern().

◆ GetPlatformName()

string CCgiUserAgent::GetPlatformName ( void  ) const

◆ GetQueryString()

string GetQueryString ( EAmpEncoding  amp_enc,
EUrlEncode  encode 
) const

Definition at line 112 of file cgi_util.hpp.

References encode, and CUrlArgs::GetQueryString().

◆ GetSessionCookie()

const CCgiCookie * CCgiSession::GetSessionCookie ( void  ) const

Get a cookie pertaining to the session.

May create new cookie, if needed and allowed to.

Returns
Session CGI cookie; NULL if no session is loaded or if cookie support is disabled.

Definition at line 193 of file cgi_session.cpp.

References CTime::AddYear(), CTime::eCurrent, CCgiSession::eDeleted, CTime::eGmt, CCgiSession::eNoCookie, CCgiSession::Exists(), CTime::IsEmpty(), CCgiSession::m_CookieSupport, CCgiSession::m_SessionCookie, CCgiSession::m_SessionCookieDomain, CCgiSession::m_SessionCookieExpTime, CCgiSession::m_SessionCookiePath, CCgiSession::m_SessionId, CCgiSession::m_SessionIdName, CCgiSession::m_Status, and NULL.

Referenced by CCgiResponse::WriteHeader().

◆ GetSessionIdName()

const string & CCgiSession::GetSessionIdName ( void  ) const
inline

Get name for session ID.

See also
SetSessionIdName

Definition at line 337 of file cgi_session.hpp.

References CCgiSession::m_SessionIdName.

Referenced by CCgiSessionSampleApplication::ProcessRequest().

◆ GetStatus()

CCgiSession::EStatus CCgiSession::GetStatus ( void  ) const
inline

Get current status of the session.

Definition at line 332 of file cgi_session.hpp.

References CCgiSession::m_Status.

Referenced by CCgiSessionSampleApplication::ProcessRequest().

◆ GetUserAgentStr()

string CCgiUserAgent::GetUserAgentStr ( void  ) const
inline

Get user agent string.

Definition at line 218 of file user_agent.hpp.

References CCgiUserAgent::m_UserAgent.

◆ IsBot()

bool CCgiUserAgent::IsBot ( TBotFlags  flags = fBotAll,
const string include_patterns = kEmptyStr,
const string exclude_patterns = kEmptyStr 
) const

Check that this is known search robot/bot.

By default it use GetEngine() and GetBrowser() value to check on known bots, and only here 'flags' parameter can be used. @include_patterns List of additional patterns that can treat current user agent as bot. If standard check fails, this string and/or registry/environment parameters (section 'CGI', name 'Bots') will be used. String value should have patterns for search in the user agent string, and should looks like: "Googlebot Scooter WebCrawler Slurp" You can use any delimiters from next list " ;|~\t". If you want to use space or any other symbol from the delimiters list as part of the pattern, then use multi-line pattern. In this case each line contains a single pattern with any symbol inside it. All patterns are case sensitive. For details how to define registry/environment parameter see CParam description. @exclude_patterns This parameter and string from (section 'CGI', name 'NotBots') can be used to remove any user agent signature from list of bots, if you don't agree with parser's decision. IsBot() will return FALSE if the user agent string contains one of these patters.

Note
Registry file: [CGI] Bots = ... NotBots = ... Environment variables: NCBI_CONFIG__CGI__Bots = ... NCBI_CONFIG__CGI__NotBots = ...
See also
GetBrowser, GetEngine, CParam

Definition at line 366 of file user_agent.cpp.

References eBot, CCgiUserAgent::eCrawler, CCgiUserAgent::eEngine_Bot, CCgiUserAgent::eLinkChecker, CCgiUserAgent::eOfflineBrowser, CCgiUserAgent::eScript, CCgiUserAgent::eWebValidator, exclude_patterns, F_ISSET, CCgiUserAgent::fBotAll, CCgiUserAgent::fBotCrawler, CCgiUserAgent::fBotLinkChecker, CCgiUserAgent::fBotOfflineBrowser, CCgiUserAgent::fBotScript, CCgiUserAgent::fBotWebValidator, flags, CCgiUserAgent::fUseDevicePatterns, CCgiUserAgent::GetBrowser(), CCgiUserAgent::GetEngine(), include_patterns, and CCgiUserAgent::x_CheckPattern().

◆ IsBrowser()

bool CCgiUserAgent::IsBrowser ( void  ) const

◆ IsMobileDevice()

bool CCgiUserAgent::IsMobileDevice ( const string include_patterns = kEmptyStr,
const string exclude_patterns = kEmptyStr 
) const

Check that this is a known mobile device.

Use this method with caution, because it is impossible to detect resolution or form-factor of the device based on user agent string only, we can only make an assumptions here. @include_patterns List of additional patterns that can treat current user agent as mobile device if standard check fails, this string and/or registry/environment parameter (section 'CGI', name 'MobileDevices') will be used. String value should have patterns for search in the user agent string, and should looks like: "Name1 Name2 Name3". You can use any delimiters from next list " ;|~\t". If you want to use space or any other symbol from the delimiters list as part of the pattern, then use multi-line pattern. In this case each line contains a single pattern with any symbol inside it. All patterns are case sensitive by default unless fNoCase flag is specified. @exclude_patterns This parameter and string from (section 'CGI', name 'NotMobileDevices') can be used to remove any user agent signature from list of mobile devices, if you don't agree with parser's decision. IsMobileDevice() will return FALSE if the user agent string contains one of these patters.

Returns
Return TRUE for all devices with user agent strings that use mobile version of browser or have any known mobile platform signatures. The device can be a phone or tablet, or any other device with the same keywords in the UA-string.
Note
Registry file: [CGI] MobileDevices = ... NotMobileDevices = ... Environment variables: NCBI_CONFIG__CGI__MobileDevices = ... NCBI_CONFIG__CGI__NotMobileDevices = ...
See also
GetDeviceType, GetPlatform, EBrowserPlatform, CParam, IsPhoneDevice, IsTabletDevice

Definition at line 442 of file user_agent.cpp.

References eMobile, ePhone, eTablet, exclude_patterns, F_ISSET, CCgiUserAgent::fDevice_Mobile, CCgiUserAgent::fUseDevicePatterns, include_patterns, CCgiUserAgent::m_DeviceFlags, and CCgiUserAgent::x_CheckPattern().

◆ IsPhoneDevice()

bool CCgiUserAgent::IsPhoneDevice ( const string include_patterns = kEmptyStr,
const string exclude_patterns = kEmptyStr 
) const

Check that this is a known phone-size device.

Use this method with caution, because it is impossible to detect resolution and form-factor of the device based on user agent string only, we can only make an assumptions here. Also, we cannot say can some device make calls or not. @include_patterns List of additional patterns that can treat current user agent as phone-size device if standard check fails, this string and/or registry/environment parameter (section 'CGI', name 'PhoneDevices') will be used. String value should have patterns for search in the user agent string, and should looks like: "Name1 Name2 Name3". You can use any delimiters from next list " ;|~\t". If you want to use space or any other symbol from the delimiters list as part of the pattern, then use multi-line pattern. In this case each line contains a single pattern with any symbol inside it. All patterns are case sensitive by default unless fNoCase flag is specified. @exclude_patterns This parameter and string from (section 'CGI', name 'NotPhoneDevices') can be used to remove any user agent signature from list of phone-size devices, if you don't agree with parser's decision. IsPhoneDevice() will return FALSE if the user agent string contains one of these patters.

Returns
Return TRUE for all user agent string that have known signatures of phone-size devices. We can detect only limited number of such devices, so be aware.
Note
Registry file: [CGI] PhoneDevices = ... NotPhoneDevices = ... Environment variables: NCBI_CONFIG__CGI__PhoneDevices = ... NCBI_CONFIG__CGI__NotPhoneDevices = ...
See also
GetDeviceType, GetPlatform, EBrowserPlatform, CParam, IsTabletDevice, IsMobileDevice

Definition at line 414 of file user_agent.cpp.

References ePhone, exclude_patterns, F_ISSET, CCgiUserAgent::fDevice_Mobile, CCgiUserAgent::fDevice_Phone, CCgiUserAgent::fUseDevicePatterns, include_patterns, CCgiUserAgent::m_DeviceFlags, and CCgiUserAgent::x_CheckPattern().

◆ IsTabletDevice()

bool CCgiUserAgent::IsTabletDevice ( const string include_patterns = kEmptyStr,
const string exclude_patterns = kEmptyStr 
) const

Check that this is a known tablet device.

Use this method with caution, because it is impossible to detect resolution or form-factor of the device based on user agent string only, we can only make an assumptions here. @include_patterns List of additional patterns that can treat current user agent as tablet device if standard check fails, this string and/or registry/environment parameter (section 'CGI', name 'TabletDevices') will be used. String value should have patterns for search in the user agent string, and should looks like: "Name1 Name2 Name3". You can use any delimiters from next list " ;|~\t". If you want to use space or any other symbol from the delimiters list as part of the pattern, then use multi-line pattern. In this case each line contains a single pattern with any symbol inside it. All patterns are case sensitive by default unless fNoCase flag is specified. @exclude_patterns This parameter and string from (section 'CGI', name 'NotTabletDevices') can be used to remove any user agent signature from list of tablet devices, if you don't agree with parser's decision. IsTabletDevice() will return FALSE if the user agent string contains one of these patters.

Note
Registry file: [CGI] TabletDevices = ... NotTabletDevices = ... Environment variables: NCBI_CONFIG__CGI__TabletDevices = ... NCBI_CONFIG__CGI__TabletDevices = ...
Returns
Return TRUE for devices that can be detected as tablets. Usually, IsMobileDevice() also return TRUE for the same user agent string. Not all devices can be detected as tablets, only few combinations of new versions of browsers and OS provide such informations in the UA-string, and limited number of device names can be used for such detection.
See also
GetDeviceType, CParam, IsMobileDevice, IsPhoneDevice

Definition at line 428 of file user_agent.cpp.

References eTablet, exclude_patterns, F_ISSET, CCgiUserAgent::fDevice_Tablet, CCgiUserAgent::fUseDevicePatterns, include_patterns, CCgiUserAgent::m_DeviceFlags, and CCgiUserAgent::x_CheckPattern().

◆ Load()

void CCgiSession::Load ( void  )

◆ LoadSession()

virtual bool ICgiSessionStorage::LoadSession ( const string sessionid)
pure virtual

Load the session The implementations must handle binary data correctly (e.g.

NULL characters in the string).

Parameters
[in]IDof the session
Returns
true if the session was loaded, false otherwise

Implemented in CCgiSession_NetCache.

Referenced by CCgiSession::Load().

◆ ModifyId()

void CCgiSession::ModifyId ( const string new_session_id)

Modify session ID.

The session must be loaded before calling this method.

Definition at line 97 of file cgi_session.cpp.

References CCgiSession::eImplNotSet, CCgiSession::Exists(), CCgiSession::m_Impl, CCgiSession::m_SessionId, ICgiSessionStorage::ModifySessionId(), and NCBI_THROW.

◆ ModifySessionId()

virtual void ICgiSessionStorage::ModifySessionId ( const string new_id)
pure virtual

Modify session id.

Change Id of the current session. The implementations must handle binary data correctly (e.g. NULL characters in the string).

Implemented in CCgiSession_NetCache.

Referenced by CCgiSession::ModifyId().

◆ operator=()

CCgiSession& CCgiSession::operator= ( const CCgiSession )
private

◆ RemoveAttribute() [1/2]

void CCgiSession::RemoveAttribute ( const string name)

Remove attribute from the session.

Parameters
[in]nameName of the attribute to remove
Exceptions
CCgiSessionExceptionif the session is not loaded.

Definition at line 172 of file cgi_session.cpp.

References CCgiSession::Load(), CCgiSession::m_Impl, and ICgiSessionStorage::RemoveAttribute().

Referenced by CCgiSessionSampleApplication::ProcessRequest().

◆ RemoveAttribute() [2/2]

virtual void ICgiSessionStorage::RemoveAttribute ( const string name)
pure virtual

Remove attribute from the session.

Parameters
[in]nameName of the attribute to remove

Implemented in CCgiSession_NetCache.

Referenced by CCgiSession::RemoveAttribute().

◆ Reset() [1/2]

virtual void ICgiSessionStorage::Reset ( )
pure virtual

Reset the session.

The an implementation should close all input/ouptut streams here.

Implemented in CCgiSession_NetCache.

Referenced by CCgiSession::CreateNewSession(), CCgiSession::SetId(), and CCgiSession::~CCgiSession().

◆ Reset() [2/2]

void CCgiUserAgent::Reset ( const string user_agent)

Parse new user agent string.

Definition at line 100 of file user_agent.cpp.

References CCgiUserAgent::x_Parse().

◆ RetrieveSessionId()

string CCgiSession::RetrieveSessionId ( ) const

◆ SetAttribute() [1/2]

void CCgiSession::SetAttribute ( const string name,
const string value 
)

Set attribute data as a string.

Parameters
[in]nameName of the attribute to set
[in]valueValue to set the attribute data to
Exceptions
CCgiSessionExceptionif the session is not loaded.

Definition at line 160 of file cgi_session.cpp.

References CCgiSession::Load(), CCgiSession::m_Impl, ICgiSessionStorage::SetAttribute(), and rapidjson::value.

◆ SetAttribute() [2/2]

virtual void ICgiSessionStorage::SetAttribute ( const string name,
const string value 
)
pure virtual

Set attribute data as a string.

Parameters
[in]nameName of the attribute to set
[in]valueValue to set the attribute data to

Implemented in CCgiSession_NetCache.

Referenced by CCgiSession::SetAttribute().

◆ SetId()

void CCgiSession::SetId ( const string session_id)

Set session ID.

The previously loaded session (if any) will be closed.

Definition at line 84 of file cgi_session.cpp.

References CCgiSession::eNotLoaded, CCgiSession::Exists(), CCgiSession::m_Impl, CCgiSession::m_SessionId, CCgiSession::m_Status, and ICgiSessionStorage::Reset().

◆ SetQueryString()

void SetQueryString ( const string query,
const IUrlEncoder encoder = 0 
)

Definition at line 99 of file cgi_util.hpp.

References query, and CUrlArgs_Parser::SetQueryString().

◆ SetSessionCookieDomain()

void CCgiSession::SetSessionCookieDomain ( const string domain)
inline

Set session cookie domain.

See also
SetSessionIdName

Definition at line 347 of file cgi_session.hpp.

References CCgiSession::m_SessionCookieDomain.

◆ SetSessionCookieExpTime()

void CCgiSession::SetSessionCookieExpTime ( const CTime exp_time)
inline

Set session cookie expiration time.

Definition at line 357 of file cgi_session.hpp.

References CCgiSession::m_SessionCookieExpTime.

◆ SetSessionCookiePath()

void CCgiSession::SetSessionCookiePath ( const string path)
inline

Set session cookie path.

See also
SetSessionIdName

Definition at line 352 of file cgi_session.hpp.

References CCgiSession::m_SessionCookiePath.

◆ SetSessionIdName()

void CCgiSession::SetSessionIdName ( const string name)
inline

Set name for session ID.

This name is used as a cookie name for a session cookie.

Definition at line 342 of file cgi_session.hpp.

References CCgiSession::m_SessionIdName.

◆ URL_DecodeInPlace()

SIZE_TYPE URL_DecodeInPlace ( string str,
EUrlDecode  decode_flag = eUrlDecode_All 
)
Deprecated:
Use NStr::URLDecodeInPlace()

Definition at line 44 of file cgi_util.cpp.

References str(), and NStr::URLDecodeInPlace().

◆ URL_DecodeString()

string URL_DecodeString ( const string str,
EUrlEncode  encode_flag = eUrlEncode_SkipMarkChars 
)

◆ URL_EncodeString()

string URL_EncodeString ( const string str,
EUrlEncode  encode_flag = eUrlEncode_SkipMarkChars 
)
Deprecated:
Use NStr::URLEncode()

Definition at line 62 of file cgi_util.cpp.

References str(), and NStr::URLEncode().

◆ x_CheckPattern()

bool CCgiUserAgent::x_CheckPattern ( int  what,
bool  current_status,
bool  use_patterns,
const string include_patterns = kEmptyStr,
const string exclude_patterns = kEmptyStr 
) const
protected

◆ x_Init()

void CCgiUserAgent::x_Init ( void  )
protected

◆ x_Load()

void CCgiSession::x_Load ( ) const
private

Definition at line 238 of file cgi_session.cpp.

References CCgiSession::Load().

Referenced by CCgiSession::GetAttribute(), and CCgiSession::GetAttributeNames().

◆ x_Parse()

void CCgiUserAgent::x_Parse ( const string user_agent)
protected

Parse user agent string.

Definition at line 871 of file user_agent.cpp.

References eBot, CCgiUserAgent::eEngine_Blink, CCgiUserAgent::eEngine_Bot, CCgiUserAgent::eEngine_Edge, CCgiUserAgent::eEngine_Gecko, CCgiUserAgent::eEngine_IE, CCgiUserAgent::eEngine_KHTML, CCgiUserAgent::eEngine_WebKit, CCgiUserAgent::eIE, eMobile, CCgiUserAgent::eMozilla, CCgiUserAgent::eMozillaCompatible, CCgiUserAgent::eNetscape, ePhone, CCgiUserAgent::ePlatform_Android, CCgiUserAgent::ePlatform_Mac, CCgiUserAgent::ePlatform_MobileDevice, CCgiUserAgent::ePlatform_Palm, CCgiUserAgent::ePlatform_Symbian, CCgiUserAgent::ePlatform_Unix, CCgiUserAgent::ePlatform_Unknown, CCgiUserAgent::ePlatform_Windows, CCgiUserAgent::ePlatform_WindowsCE, CCgiUserAgent::eSafari, CCgiUserAgent::eSafariMobile, eTablet, CCgiUserAgent::eUnknown, F_ISSET, fAny, fAppComment, fAppProduct, CCgiUserAgent::fDevice_Mobile, CCgiUserAgent::fDevice_Phone, CCgiUserAgent::fDevice_Tablet, CCgiUserAgent::fUseBotPatterns, CCgiUserAgent::fUseDevicePatterns, fVendorProduct, CVersionInfo::GetMajor(), len, CCgiUserAgent::m_Browser, CCgiUserAgent::m_BrowserName, CCgiUserAgent::m_BrowserVersion, CCgiUserAgent::m_DeviceFlags, CCgiUserAgent::m_Engine, CCgiUserAgent::m_EngineVersion, CCgiUserAgent::m_MozillaVersion, CCgiUserAgent::m_Platform, CCgiUserAgent::m_UserAgent, NStr::MatchesMask(), NPOS, s_ParseVersion(), CVersionInfo::SetVersion(), NStr::TruncateSpaces(), USTR, CCgiUserAgent::x_CheckPattern(), CCgiUserAgent::x_Init(), and CCgiUserAgent::x_ParseToken().

Referenced by CCgiUserAgent::CCgiUserAgent(), and CCgiUserAgent::Reset().

◆ x_ParseToken()

bool CCgiUserAgent::x_ParseToken ( const string token,
int  where,
EBrowserEngine  engine = eEngine_Unknown 
)
protected

Parse token with browser name and version.

'where' flag specifies what part of the user agent to look at, 'engine' allow to check a specific type of engine in the lookup table.

Definition at line 1236 of file user_agent.cpp.

References CCgiUserAgent::eEngine_Unknown, SBrowser::engine, CCgiUserAgent::ePlatform_Unknown, flags, i, kBrowsers, ncbi::grid::netcache::search::fields::key, len, CCgiUserAgent::m_Browser, CCgiUserAgent::m_BrowserName, CCgiUserAgent::m_BrowserVersion, CCgiUserAgent::m_Engine, CCgiUserAgent::m_Platform, SBrowser::name, NPOS, SBrowser::platform, s_Browsers, s_ParseVersion(), SBrowser::type, and USTR.

Referenced by CCgiUserAgent::x_Parse().

◆ ~CCgiSession()

CCgiSession::~CCgiSession ( )

◆ ~ICgiSessionStorage()

ICgiSessionStorage::~ICgiSessionStorage ( )
virtual

Definition at line 244 of file cgi_session.cpp.

Variable Documentation

◆ CCgiArgs

Deprecated:
Use CUrlArgs

Definition at line 106 of file cgi_util.hpp.

◆ CCgiArgs_Parser

Deprecated:
Use CUrlArgs_Parser

Definition at line 93 of file cgi_util.hpp.

◆ decode

Definition at line 110 of file cgi_util.hpp.

Referenced by CUrlArgs::CUrlArgs(), and main().

◆ encode

◆ kDefaultSessionCookieDomain

const char * CCgiSession::kDefaultSessionCookieDomain = ".nih.gov"
static

Definition at line 67 of file cgi_session.hpp.

◆ kDefaultSessionCookiePath

const char * CCgiSession::kDefaultSessionCookiePath = "/"
static

Definition at line 68 of file cgi_session.hpp.

◆ kDefaultSessionIdName

const char * CCgiSession::kDefaultSessionIdName = "ncbi_session_data"
static

Definition at line 66 of file cgi_session.hpp.

◆ m_Browser

EBrowser CCgiUserAgent::m_Browser
protected

◆ m_BrowserName

string CCgiUserAgent::m_BrowserName
protected

◆ m_BrowserVersion

TUserAgentVersion CCgiUserAgent::m_BrowserVersion
protected

◆ m_CookieSupport

ECookieSupport CCgiSession::m_CookieSupport
private

◆ m_DeviceFlags

TDeviceFlags CCgiUserAgent::m_DeviceFlags
protected

◆ m_Engine

EBrowserEngine CCgiUserAgent::m_Engine
protected

◆ m_EngineVersion

TUserAgentVersion CCgiUserAgent::m_EngineVersion
protected

Browser engine version.

Definition at line 479 of file user_agent.hpp.

Referenced by CCgiUserAgent::GetEngineVersion(), CCgiUserAgent::x_Init(), and CCgiUserAgent::x_Parse().

◆ m_Flags

TFlags CCgiUserAgent::m_Flags
protected

Comparison and parsing flags.

Definition at line 474 of file user_agent.hpp.

Referenced by CCgiUserAgent::CCgiUserAgent().

◆ m_Impl

ICgiSessionStorage* CCgiSession::m_Impl
private

◆ m_ImplGuard

unique_ptr<ICgiSessionStorage> CCgiSession::m_ImplGuard
private

Definition at line 214 of file cgi_session.hpp.

Referenced by CCgiSession::CCgiSession().

◆ m_MozillaVersion

TUserAgentVersion CCgiUserAgent::m_MozillaVersion
protected

Browser mozilla version.

Definition at line 480 of file user_agent.hpp.

Referenced by CCgiUserAgent::GetMozillaVersion(), CCgiUserAgent::x_Init(), and CCgiUserAgent::x_Parse().

◆ m_Platform

EBrowserPlatform CCgiUserAgent::m_Platform
protected

◆ m_Request

const CCgiRequest& CCgiSession::m_Request
private

Definition at line 212 of file cgi_session.hpp.

Referenced by CCgiSession::RetrieveSessionId().

◆ m_SessionCookie

unique_ptr<CCgiCookie> CCgiSession::m_SessionCookie
private

Definition at line 223 of file cgi_session.hpp.

Referenced by CCgiSession::GetSessionCookie().

◆ m_SessionCookieDomain

string CCgiSession::m_SessionCookieDomain
private

◆ m_SessionCookieExpTime

CTime CCgiSession::m_SessionCookieExpTime
private

◆ m_SessionCookiePath

string CCgiSession::m_SessionCookiePath
private

◆ m_SessionId

string CCgiSession::m_SessionId
private

◆ m_SessionIdName

string CCgiSession::m_SessionIdName
private

◆ m_Status

EStatus CCgiSession::m_Status
private

◆ m_UserAgent

string CCgiUserAgent::m_UserAgent
protected
Modified on Sun Apr 21 03:44:21 2024 by modify_doxy.py rev. 669887