NCBI C++ ToolKit
|
Util members. More...
Classes | |
class | IUrlEncoder |
IUrlEncoder:: More... | |
class | CEmptyUrlEncoder |
Primitive encoder - all methods return the argument value. More... | |
class | CDefaultUrlEncoder |
Default encoder, uses the selected encoding for argument names/values and eUrlEncode_Path for document path. More... | |
class | CUrlArgs_Parser |
CUrlArgs_Parser:: More... | |
class | CUrlArgs |
CUrlArgs:: More... | |
struct | CUrlArgs::SUrlArg |
Name-value pair. More... | |
class | CUrl |
CUrl –. More... | |
class | CUrlException |
CUrlException –. More... | |
class | CUrlParserException |
CUrlParserException –. More... | |
class | CApplogUrl |
CApplogUrl:: More... | |
Macros | |
#define | NCBI_SCHEME_SERVICE "ncbilb" |
CUrl:: More... | |
Typedefs | |
typedef int | CUrlArgs_Parser::TFlags |
An inverted subset of CCgiRequest::TFlags. More... | |
typedef SUrlArg | CUrlArgs::TArg |
typedef list< TArg > | CUrlArgs::TArgs |
typedef TArgs::iterator | CUrlArgs::iterator |
typedef TArgs::const_iterator | CUrlArgs::const_iterator |
typedef int | CUrl::TAdjustFlags |
Util members.
#define NCBI_SCHEME_SERVICE "ncbilb" |
typedef TArgs::const_iterator CUrlArgs::const_iterator |
Definition at line 278 of file ncbi_url.hpp.
typedef TArgs::iterator CUrlArgs::iterator |
Definition at line 277 of file ncbi_url.hpp.
typedef int CUrl::TAdjustFlags |
Definition at line 467 of file ncbi_url.hpp.
typedef SUrlArg CUrlArgs::TArg |
Definition at line 275 of file ncbi_url.hpp.
typedef list<TArg> CUrlArgs::TArgs |
Definition at line 276 of file ncbi_url.hpp.
typedef int CUrlArgs_Parser::TFlags |
An inverted subset of CCgiRequest::TFlags.
Definition at line 174 of file ncbi_url.hpp.
enum CUrl::EAdjustFlags |
Flags controlling URL adjustment.
Definition at line 452 of file ncbi_url.hpp.
Ampersand encoding for composed URLs.
Enumerator | |
---|---|
eAmp_Char | Use & to separate arguments. |
eAmp_Entity | Encode '&' as "&". |
Definition at line 253 of file ncbi_url.hpp.
|
protected |
Query type flag.
Enumerator | |
---|---|
eArg_Value | Query contains name=value pairs. |
eArg_Index | Query contains a list of names: name1+name2+name3. |
Definition at line 203 of file ncbi_url.hpp.
Enumerator | |
---|---|
eName | |
eNoArgs | |
eFlags |
Definition at line 513 of file ncbi_url.hpp.
Enumerator | |
---|---|
eFormat |
Definition at line 541 of file ncbi_url.hpp.
Enumerator | |
---|---|
fSemicolonIsArgDelimiter | Treat semicolon as query string argument separator. |
fEnableParsingAsIndex | Enable parsing input as 'indexed' query (RFC3875) when no '=' is present. |
Definition at line 175 of file ncbi_url.hpp.
|
protectedvirtual |
Process next query argument.
Must be overriden to process and store the arguments.
position | 1-based index of the argument in the query. |
name | Name of the argument. |
value | Contains argument value if query type is eArg_Value or empty string for eArg_Index. |
arg_type | Query type flag. |
Implements CUrlArgs_Parser.
Definition at line 210 of file ncbi_url.cpp.
References _ASSERT, CUrlArgs_Parser::eArg_Index, CUrlArgs::m_Args, CUrlArgs::m_IsIndex, and rapidjson::value.
|
protectedpure virtual |
Process next query argument.
Must be overriden to process and store the arguments.
position | 1-based index of the argument in the query. |
name | Name of the argument. |
value | Contains argument value if query type is eArg_Value or empty string for eArg_Index. |
arg_type | Query type flag. |
Implemented in CCgiEntries_Parser, and CUrlArgs.
Referenced by CUrlArgs_Parser::SetQueryString(), and CUrlArgs_Parser::x_SetIndexString().
Add new value even if an argument with the same name already exists.
Definition at line 283 of file ncbi_url.cpp.
References CUrlArgs::m_Args, CUrlArgs::m_IsIndex, and rapidjson::value.
Referenced by CPSGDataLoader_Impl::CPSGDataLoader_Impl().
void CUrl::Adjust | ( | const CUrl & | other, |
TAdjustFlags | flags | ||
) |
Adjust this URL using information from 'other' URL.
Host and port are never changed. Other parts can be replaced or merged depending on the flags. Throw CUrlException if the flags are inconsistent (e.g. both fPath_Replace and fPath_Append are set).
Definition at line 684 of file ncbi_url.cpp.
References CUrl::fArgs_Append, CUrl::fArgs_Merge, CUrl::fArgs_Replace, CUrl::fFragment_Replace, CUrl::fFragment_ReplaceIfEmpty, flags, CUrl::fPassword_Replace, CUrl::fPassword_ReplaceIfEmpty, CUrl::fPath_Append, CUrl::fPath_Replace, CUrl::fScheme_Replace, CUrl::fUser_Replace, CUrl::fUser_ReplaceIfEmpty, ITERATE, CUrl::m_ArgsList, CUrl::m_Fragment, CUrl::m_OrigArgs, CUrl::m_Password, CUrl::m_Path, CUrl::m_Scheme, CUrl::m_User, and NCBI_THROW.
Referenced by CHttpRequest::sx_Adjust().
Default constructor.
Definition at line 59 of file ncbi_applog_url.hpp.
|
inline |
Definition at line 126 of file ncbi_url.hpp.
|
inline |
Clear the list.
Definition at line 250 of file ncbi_url.hpp.
References CUrlArgs::m_Args, and CUrlArgs::m_IsIndex.
Referenced by CCgiContext::GetSelfURL().
string CUrl::ComposeUrl | ( | CUrlArgs::EAmpEncoding | amp_enc, |
const IUrlEncoder * | encoder = 0 |
||
) | const |
Compose the URL.
amp_enc | Method of encoding ampersand. |
encoder | URL encoder object. If not set, the default encoder will be used. |
Definition at line 580 of file ncbi_url.cpp.
References IUrlEncoder::EncodeFragment(), IUrlEncoder::EncodePassword(), IUrlEncoder::EncodePath(), IUrlEncoder::EncodeUser(), NStr::eUrlEnc_ProcessMarkChars, CUrl::GetDefaultEncoder(), CUrl::HaveArgs(), CUrl::IsService(), CUrl::m_ArgsList, CUrl::m_Fragment, CUrl::m_Host, CUrl::m_IsGeneric, CUrl::m_Password, CUrl::m_Path, CUrl::m_Port, CUrl::m_Scheme, CUrl::m_Service, CUrl::m_User, NCBI_SCHEME_SERVICE, and NStr::URLEncode().
Referenced by CSDB_ConnectionParam::ComposeUrl(), CCgiContext::GetSelfURL(), CHttpSessionApp::Run(), CCgiResponse::SetLocation(), CRetryContext::SetUrl(), CHttpRequest::sx_Adjust(), and CHttpRequest::x_InitConnection().
string CApplogUrl::ComposeUrl | ( | void | ) |
Compose URL.
Definition at line 83 of file ncbi_applog_url.cpp.
References CTime::AddSecond(), AND_TERM, CTime::AsString(), NStr::eQuoted, CTime::eRound_Minute, CTime::GetLocalTime(), CTime::IsEmpty(), kDefaultApplogArgs, kDefaultApplogURL, CApplogUrl::m_AppName, CApplogUrl::m_Client, CApplogUrl::m_Host, CApplogUrl::m_Logsite, CApplogUrl::m_PHID, CApplogUrl::m_PID, CApplogUrl::m_RID, CApplogUrl::m_Session, CApplogUrl::m_TID, CApplogUrl::m_TimeEnd, CApplogUrl::m_TimeStart, CApplogUrl::m_Url, CTime::Round(), s_AddArg(), s_AddTerm(), CTime::SetCurrent(), and CTime::ToLocalTime().
Referenced by CNcbiApplogApp::Run().
|
inline |
Definition at line 372 of file ncbi_url.hpp.
Definition at line 346 of file ncbi_url.cpp.
CUrl::CUrl | ( | const string & | url, |
const IUrlEncoder * | encoder = 0 |
||
) |
Parse the URL.
url | String to parse as URL: Generic: [scheme://[[user]:[password]@]]host[:port][/path][?args][#frag] Special: scheme:[path] The leading '/', if any, is included in the path value. |
encoder | URL encoder object. If not set, the default encoder will be used. |
Definition at line 339 of file ncbi_url.cpp.
References CUrl_Base::SetUrl().
CUrlArgs::CUrlArgs | ( | const string & | query, |
const IUrlEncoder * | encoder = 0 , |
||
TFlags | flags = 0 |
||
) |
Parse the query string, store the arguments.
Definition at line 201 of file ncbi_url.cpp.
References query, and CUrlArgs_Parser::SetQueryString().
CUrlArgs::CUrlArgs | ( | const string & | query, |
NStr::EUrlEncode | decode, | ||
TFlags | flags = 0 |
||
) |
Parse the query string, store the arguments.
Definition at line 192 of file ncbi_url.cpp.
References decode, query, and CUrlArgs_Parser::SetQueryString().
CUrlArgs::CUrlArgs | ( | TFlags | flags = 0 | ) |
Create an empty arguments set.
Definition at line 183 of file ncbi_url.cpp.
|
inline |
Definition at line 182 of file ncbi_url.hpp.
Decode URL argument name.
Implements IUrlEncoder.
Reimplemented in CDefaultUrlEncoder.
Definition at line 107 of file ncbi_url.hpp.
Decode URL argument name.
Reimplemented from CEmptyUrlEncoder.
Definition at line 142 of file ncbi_url.hpp.
References NStr::eUrlDec_All, NStr::eUrlDec_Percent, NStr::eUrlEnc_PercentOnly, CDefaultUrlEncoder::m_Encode, and NStr::URLDecode().
Decode URL argument name.
Implemented in CDefaultUrlEncoder, and CEmptyUrlEncoder.
Referenced by CUrlArgs_Parser::SetQueryString(), and CUrlArgs_Parser::x_SetIndexString().
Decode URL argument value.
Implements IUrlEncoder.
Reimplemented in CDefaultUrlEncoder.
Definition at line 111 of file ncbi_url.hpp.
References rapidjson::value.
Decode URL argument value.
Reimplemented from CEmptyUrlEncoder.
Definition at line 148 of file ncbi_url.hpp.
References NStr::eUrlDec_All, NStr::eUrlDec_Percent, NStr::eUrlEnc_PercentOnly, CDefaultUrlEncoder::m_Encode, NStr::URLDecode(), and rapidjson::value.
Decode URL argument value.
Implemented in CDefaultUrlEncoder, and CEmptyUrlEncoder.
Referenced by CUrlArgs_Parser::SetQueryString().
Decode fragment.
Implements IUrlEncoder.
Reimplemented in CDefaultUrlEncoder.
Definition at line 115 of file ncbi_url.hpp.
References rapidjson::value.
Decode fragment.
Reimplemented from CEmptyUrlEncoder.
Definition at line 154 of file ncbi_url.hpp.
References NStr::eUrlDec_Percent, NStr::URLDecode(), and rapidjson::value.
Decode fragment.
Implemented in CDefaultUrlEncoder, and CEmptyUrlEncoder.
Referenced by CUrl::x_SetFragment().
Decode password.
Implements IUrlEncoder.
Reimplemented in CDefaultUrlEncoder.
Definition at line 99 of file ncbi_url.hpp.
Decode password.
Reimplemented from CEmptyUrlEncoder.
Definition at line 134 of file ncbi_url.hpp.
References NStr::eUrlDec_Percent, and NStr::URLDecode().
Decode password.
Implemented in CDefaultUrlEncoder, and CEmptyUrlEncoder.
Referenced by CUrl::x_SetPassword().
Decode path on server.
Implements IUrlEncoder.
Reimplemented in CDefaultUrlEncoder.
Definition at line 103 of file ncbi_url.hpp.
Decode path on server.
Reimplemented from CEmptyUrlEncoder.
Definition at line 138 of file ncbi_url.hpp.
References NStr::URLDecode().
Decode path on server.
Implemented in CDefaultUrlEncoder, and CEmptyUrlEncoder.
Referenced by CUrl::x_SetPath().
Decode user name.
Implements IUrlEncoder.
Reimplemented in CDefaultUrlEncoder.
Definition at line 95 of file ncbi_url.hpp.
Decode user name.
Reimplemented from CEmptyUrlEncoder.
Definition at line 130 of file ncbi_url.hpp.
References NStr::eUrlDec_Percent, and NStr::URLDecode().
Decode user name.
Implemented in CDefaultUrlEncoder, and CEmptyUrlEncoder.
Referenced by CUrl::x_SetUser().
Encode URL argument name.
Implements IUrlEncoder.
Reimplemented in CFormDataEncoder, and CDefaultUrlEncoder.
Definition at line 105 of file ncbi_url.hpp.
Encode URL argument name.
Reimplemented from CEmptyUrlEncoder.
Definition at line 140 of file ncbi_url.hpp.
References CDefaultUrlEncoder::m_Encode, and NStr::URLEncode().
Encode URL argument name.
Implemented in CFormDataEncoder, CDefaultUrlEncoder, and CEmptyUrlEncoder.
Encode URL argument value.
Implements IUrlEncoder.
Reimplemented in CFormDataEncoder, and CDefaultUrlEncoder.
Definition at line 109 of file ncbi_url.hpp.
References rapidjson::value.
Encode URL argument value.
Reimplemented from CEmptyUrlEncoder.
Definition at line 146 of file ncbi_url.hpp.
References CDefaultUrlEncoder::m_Encode, NStr::URLEncode(), and rapidjson::value.
Encode URL argument value.
Implemented in CFormDataEncoder, CDefaultUrlEncoder, and CEmptyUrlEncoder.
Referenced by SPSG_ArgsBase::CUrlArgs().
Encode fragment.
Implements IUrlEncoder.
Reimplemented in CDefaultUrlEncoder.
Definition at line 113 of file ncbi_url.hpp.
References rapidjson::value.
Encode fragment.
Reimplemented from CEmptyUrlEncoder.
Definition at line 152 of file ncbi_url.hpp.
References NStr::eUrlEnc_URIFragment, NStr::URLEncode(), and rapidjson::value.
Encode fragment.
Implemented in CDefaultUrlEncoder, and CEmptyUrlEncoder.
Referenced by CUrl::ComposeUrl().
Encode password.
Implements IUrlEncoder.
Reimplemented in CDefaultUrlEncoder.
Definition at line 97 of file ncbi_url.hpp.
Encode password.
Reimplemented from CEmptyUrlEncoder.
Definition at line 132 of file ncbi_url.hpp.
References NStr::eUrlEnc_URIUserinfo, and NStr::URLEncode().
Encode password.
Implemented in CDefaultUrlEncoder, and CEmptyUrlEncoder.
Referenced by CUrl::ComposeUrl().
Encode path on server.
Implements IUrlEncoder.
Reimplemented in CDefaultUrlEncoder.
Definition at line 101 of file ncbi_url.hpp.
Encode path on server.
Reimplemented from CEmptyUrlEncoder.
Definition at line 136 of file ncbi_url.hpp.
References NStr::eUrlEnc_URIPath, and NStr::URLEncode().
Encode path on server.
Implemented in CDefaultUrlEncoder, and CEmptyUrlEncoder.
Referenced by CUrl::ComposeUrl().
Encode user name.
Implements IUrlEncoder.
Reimplemented in CDefaultUrlEncoder.
Definition at line 93 of file ncbi_url.hpp.
Encode user name.
Reimplemented from CEmptyUrlEncoder.
Definition at line 128 of file ncbi_url.hpp.
References NStr::eUrlEnc_URIUserinfo, and NStr::URLEncode().
Encode user name.
Implemented in CDefaultUrlEncoder, and CEmptyUrlEncoder.
Referenced by CUrl::ComposeUrl().
|
inline |
Find the first argument with the given name.
If not found, return GetArgs().end().
Definition at line 667 of file ncbi_url.hpp.
References CUrlArgs::m_Args, and CUrlArgs::x_Find().
Referenced by g_ParseNSOutput(), CUrlArgs::GetValue(), CUrlArgs::IsSetValue(), SNetScheduleOutputParser::operator()(), CUrlArgs::SetUniqueValue(), and CUrlArgs::SetValue().
|
inline |
Find the first argument with the given name.
If not found, return GetArgs().end().
Definition at line 660 of file ncbi_url.hpp.
References CUrlArgs::m_Args, and CUrlArgs::x_Find().
|
inline |
Take argument name from the iterator, find next argument with the same name, return GetArgs().end() if not found.
Definition at line 674 of file ncbi_url.hpp.
References next(), and CUrlArgs::x_Find().
|
inline |
Take argument name from the iterator, find next argument with the same name, return GetArgs().end() if not found.
Definition at line 683 of file ncbi_url.hpp.
References next(), and CUrlArgs::x_Find().
Referenced by CUrlArgs::SetUniqueValue().
|
inline |
Get the list of arguments.
Definition at line 304 of file ncbi_url.hpp.
References CUrlArgs::m_Args.
|
inline |
Get list of arguments.
Definition at line 650 of file ncbi_url.hpp.
References CUrl::GetDefaultEncoder(), kEmptyStr, CUrl::m_ArgsList, and CUrl::x_SetArgs().
Get the const list of arguments.
Definition at line 300 of file ncbi_url.hpp.
References CUrlArgs::m_Args.
Referenced by SNetStorage::SConfig::BuildImpl(), CReadCmdExecutor::Consider(), CPSGDataLoader_Impl::CPSGDataLoader_Impl(), g_ParseNSOutput(), SNetScheduleAPIImpl::GetQueueParams(), CSDB_ConnectionParam::IsEmpty(), CNetCacheServerListener::OnConnected(), SNetScheduleAPIImpl::SServerParamsSync::operator()(), SNetScheduleOutputParser::operator()(), CNetService::PrintCmdOutput(), s_DoParseGet2JobResponse(), s_GetAttributes(), s_ParseQueueInfo(), s_ParseReadJobResponse(), CSDB_ConnectionParam::Set(), SPSG_UserArgs::SPSG_UserArgs(), CCgiApplication::x_OnEvent(), and CSDB_ConnectionParam::x_ReportOverride().
Get const list of arguments.
Definition at line 674 of file ncbi_url.cpp.
References CUrl::m_ArgsList, and NCBI_THROW.
Referenced by CSDB_ConnectionParam::CSDB_ConnectionParam(), CSDB_ConnectionParam::Get(), CSDB_ConnectionParam::GetArgs(), CRefArgs::GetQueryString(), CCgiContext::GetSelfURL(), CSDB_ConnectionParam::IsEmpty(), PortalBookURLToCCddBookRef(), CHttpSessionApp::Run(), CSDB_ConnectionParam::Set(), CSDB_ConnectionParam::x_FillLowerParams(), and CSDB_ConnectionParam::x_ReportOverride().
|
static |
Return default URL encoder.
Definition at line 808 of file ncbi_url.cpp.
References CSafeStatic< T, Callbacks >::Get().
Referenced by CUrl::ComposeUrl(), CUrl::GetArgs(), CUrlArgs::GetQueryString(), CUrlArgs_Parser::SetQueryString(), and CUrl::SetUrl().
|
inlineoverridevirtual |
Get error code interpreted as text.
Reimplemented from CException.
Definition at line 518 of file ncbi_url.hpp.
References CUrlException::eFlags, CUrlException::eName, CUrlException::eNoArgs, CException::GetErrCode(), and CException::GetErrCodeString().
|
inlineoverridevirtual |
Translate from the error code value to its string representation.
Reimplemented from CParseTemplException< CUrlException >.
Definition at line 545 of file ncbi_url.hpp.
References CUrlParserException::eFormat, CParseTemplException< CUrlException >::GetErrCode(), and CException::GetErrCodeString().
Definition at line 424 of file ncbi_url.hpp.
References CUrl::m_Fragment.
Referenced by PortalBookURLToCCddBookRef().
Definition at line 411 of file ncbi_url.hpp.
References CUrl::m_Host.
Referenced by CHttpCookies::Add(), CCompressedFile::CCompressedFile(), CHttpCookie_CI::CHttpCookie_CI(), CSDB_ConnectionParam::ComposeUrl(), CTrackConfigManager::CreateDisplayName(), CCompressedFile::FileExists(), CSDB_ConnectionParam::Get(), CRefArgs::GetQueryString(), CSDB_ConnectionParam::IsEmpty(), CLayoutTrack::isRemotePath(), CHttpCookie::Match(), CUrl::SetScheme(), CSDB_ConnectionParam::x_FillParamMap(), CCompressedFile::x_GetProtocol(), CCompressedFile::x_GuessFormatNetwork(), and CSDB_ConnectionParam::x_ReportOverride().
|
inline |
Generic schemes use '//' prefix (after optional scheme).
Definition at line 402 of file ncbi_url.hpp.
References CUrl::m_IsGeneric.
Get the original (unparsed and undecoded) query string.
Definition at line 428 of file ncbi_url.hpp.
References CUrl::m_OrigArgs.
Referenced by CSDB_ConnectionParam::Get().
Definition at line 408 of file ncbi_url.hpp.
References CUrl::m_Password.
Referenced by CSDB_ConnectionParam::ComposeUrl(), CSDB_ConnectionParam::Get(), and CSDB_ConnectionParam::IsEmpty().
Definition at line 421 of file ncbi_url.hpp.
References CUrl::m_Path.
Referenced by CHttpCookies::Add(), CCompressedFile::CCompressedFile(), CSDB_ConnectionParam::ComposeUrl(), CSDB_ConnectionParam::Get(), CCgiContext::GetSelfURL(), CSDB_ConnectionParam::IsEmpty(), CHttpCookie::Match(), PortalBookURLToCCddBookRef(), and CCompressedFile::x_GuessFormatNetwork().
Definition at line 418 of file ncbi_url.hpp.
References CUrl::m_Port.
Referenced by CSDB_ConnectionParam::Get(), CCgiContext::GetSelfURL(), and CSDB_ConnectionParam::IsEmpty().
string CUrlArgs::GetQueryString | ( | EAmpEncoding | amp_enc, |
const IUrlEncoder * | encoder = 0 |
||
) | const |
Construct and return complete query string.
Use selected amp and name/value encodings.
Definition at line 233 of file ncbi_url.cpp.
References CUrlArgs::eAmp_Char, CUrl::GetDefaultEncoder(), ITERATE, CUrlArgs::m_Args, and query.
string CUrlArgs::GetQueryString | ( | EAmpEncoding | amp_enc, |
NStr::EUrlEncode | encode | ||
) | const |
Construct and return complete query string.
Use selected amp and name/value encodings.
Definition at line 225 of file ncbi_url.cpp.
References encode.
Referenced by SDataId::Get(), GetQueryString(), SDebugPrintout::Print(), CRPCClient_Base::SetArgs(), CRetryContext::SetArgs(), and CHttpFormData::WriteFormData().
Definition at line 398 of file ncbi_url.hpp.
References CUrl::m_Scheme.
Referenced by CCompressedFile::FileExists(), CCgiContext::GetSelfURL(), CHttpCookie::Match(), SH2S_IoCoordinator::NewSession(), CCompressedFile::x_GetProtocol(), and CHttpRequest::x_InitConnection().
Definition at line 415 of file ncbi_url.hpp.
References CUrl::m_Service.
Referenced by CHttpRequest::x_InitConnection().
Definition at line 405 of file ncbi_url.hpp.
References CUrl::m_User.
Referenced by CSDB_ConnectionParam::ComposeUrl(), CSDB_ConnectionParam::Get(), and CSDB_ConnectionParam::IsEmpty().
Get value for the given name.
finds first of the arguments with the given name. If the name does not exist, is_found is set to false. If is_found is null, CUrlArgsException is thrown.
Definition at line 256 of file ncbi_url.cpp.
References CUrlArgs::FindFirst(), kEmptyStr, CUrlArgs::m_Args, and NCBI_THROW.
Referenced by CProjectStorage::CProjectStorage(), CSDB_ConnectionParam::Get(), CRefArgs::GetQueryString(), SPSG_Args::GetValue(), PortalBookURLToCCddBookRef(), and CGencollService::x_Connect().
|
inline |
Check if the URL contains any arguments.
Definition at line 431 of file ncbi_url.hpp.
References CUrl::m_ArgsList.
Referenced by CUrl::ComposeUrl(), CRefArgs::GetQueryString(), and CSDB_ConnectionParam::IsEmpty().
bool CUrl::IsEmpty | ( | void | ) | const |
Definition at line 815 of file ncbi_url.cpp.
References CUrl::IsService(), CUrl::m_Host, and CUrl::m_Path.
Referenced by CCgiContext::GetSelfURL(), and CHttpCookie::Match().
|
inline |
Definition at line 414 of file ncbi_url.hpp.
References CUrl::m_Service.
Referenced by CUrl::ComposeUrl(), CUrl::IsEmpty(), CUrl::SetScheme(), and CHttpRequest::x_InitConnection().
Check if an argument with the given name exists.
Definition at line 281 of file ncbi_url.hpp.
References CUrlArgs::FindFirst(), and CUrlArgs::m_Args.
Referenced by CRefArgs::GetQueryString(), PortalBookURLToCCddBookRef(), CSDB_ConnectionParam::Set(), and CGencollService::x_Connect().
CUrlException::NCBI_EXCEPTION_DEFAULT | ( | CUrlException | , |
CException | |||
) |
CUrlParserException::NCBI_EXCEPTION_DEFAULT2 | ( | CUrlParserException | , |
CParseTemplException< CUrlException > | , | ||
std::string::size_type | |||
) |
Definition at line 352 of file ncbi_url.cpp.
References CUrl::m_ArgsList, CUrl::m_Fragment, CUrl::m_Host, CUrl::m_IsGeneric, CUrl::m_OrigArgs, CUrl::m_Password, CUrl::m_Path, CUrl::m_Port, CUrl::m_Scheme, CUrl::m_Service, and CUrl::m_User.
Setters.
Definition at line 62 of file ncbi_applog_url.hpp.
References CApplogUrl::m_AppName, and rapidjson::value.
Referenced by CNcbiApplogApp::Run().
|
inline |
Select case sensitivity of arguments' names.
Definition at line 324 of file ncbi_url.hpp.
References CUrlArgs::m_Case.
Definition at line 71 of file ncbi_applog_url.hpp.
References CApplogUrl::m_Client, and rapidjson::value.
Definition at line 75 of file ncbi_applog_url.hpp.
References CApplogUrl::m_TimeEnd, and CApplogUrl::m_TimeStart.
Referenced by CNcbiApplogApp::Run().
Definition at line 425 of file ncbi_url.hpp.
References CUrl::m_Fragment, and rapidjson::value.
Referenced by CCgiContext::GetSelfURL().
Definition at line 72 of file ncbi_applog_url.hpp.
References CApplogUrl::m_PHID, and rapidjson::value.
Referenced by CNcbiApplogApp::Run().
Definition at line 569 of file ncbi_url.hpp.
References CUrl::m_Host, and CUrl::m_Service.
Referenced by CCgiContext::GetSelfURL(), and CSDB_ConnectionParam::Set().
Definition at line 63 of file ncbi_applog_url.hpp.
References CApplogUrl::m_Host, and rapidjson::value.
Referenced by CNcbiApplogApp::Run().
|
inline |
Definition at line 403 of file ncbi_url.hpp.
References CUrl::m_IsGeneric, and rapidjson::value.
Referenced by CSDB_ConnectionParam::CSDB_ConnectionParam(), and CCgiContext::GetSelfURL().
Definition at line 73 of file ncbi_applog_url.hpp.
References CApplogUrl::m_Logsite, and rapidjson::value.
Referenced by CNcbiApplogApp::Run().
Definition at line 409 of file ncbi_url.hpp.
References CUrl::m_Password, and rapidjson::value.
Referenced by CSDB_ConnectionParam::ComposeUrl(), and CSDB_ConnectionParam::Set().
Definition at line 422 of file ncbi_url.hpp.
References CUrl::m_Path, and rapidjson::value.
Referenced by CCgiContext::GetSelfURL(), CHttpSessionApp::Run(), and CSDB_ConnectionParam::Set().
Definition at line 419 of file ncbi_url.hpp.
References CUrl::m_Port, and rapidjson::value.
Referenced by CCgiContext::GetSelfURL(), and CSDB_ConnectionParam::Set().
|
inline |
Definition at line 64 of file ncbi_applog_url.hpp.
References CApplogUrl::SetProcessID_Str(), NStr::UInt8ToString(), and rapidjson::value.
Referenced by CNcbiApplogApp::Run().
Definition at line 65 of file ncbi_applog_url.hpp.
References CApplogUrl::m_PID, and rapidjson::value.
Referenced by CApplogUrl::SetProcessID().
void CUrlArgs_Parser::SetQueryString | ( | const string & | query, |
const IUrlEncoder * | encoder = 0 |
||
) |
Parse query string, call AddArgument() to store each value.
Definition at line 88 of file ncbi_url.cpp.
References CUrlArgs_Parser::AddArgument(), NStr::CompareNocase(), IUrlEncoder::DecodeArgName(), IUrlEncoder::DecodeArgValue(), CUrlArgs_Parser::eArg_Value, CUrlArgs_Parser::fEnableParsingAsIndex, CUrlArgs_Parser::fSemicolonIsArgDelimiter, CUrl::GetDefaultEncoder(), len, CUrlArgs_Parser::m_Flags, NCBI_THROW2, NPOS, query, rapidjson::value, and CUrlArgs_Parser::x_SetIndexString().
void CUrlArgs_Parser::SetQueryString | ( | const string & | query, |
NStr::EUrlEncode | encode | ||
) |
Parse query string, call AddArgument() to store each value.
Definition at line 49 of file ncbi_url.cpp.
Referenced by CUrlArgs::CUrlArgs(), CCgiRequest::ParseEntries(), CCgiRequest::ParseIndexes(), CHttpSessionApp::Run(), CSDB_ConnectionParam::Set(), SetQueryString(), and CCgiRequest::x_ProcessQueryString().
|
inline |
Definition at line 68 of file ncbi_applog_url.hpp.
References CApplogUrl::SetRequestID_Str(), NStr::UInt8ToString(), and rapidjson::value.
Referenced by CNcbiApplogApp::Run().
Definition at line 69 of file ncbi_applog_url.hpp.
References CApplogUrl::m_RID, and rapidjson::value.
Referenced by CApplogUrl::SetRequestID().
Definition at line 651 of file ncbi_url.cpp.
References CUrl::GetHost(), CUrl::IsService(), CUrl::m_Scheme, NCBI_SCHEME_SERVICE, NPOS, rapidjson::value, and CUrl::x_SetService().
Referenced by CSDB_ConnectionParam::CSDB_ConnectionParam(), and CCgiContext::GetSelfURL().
Treat semicolon as query string argument separator.
Definition at line 192 of file ncbi_url.hpp.
References CUrlArgs_Parser::fSemicolonIsArgDelimiter, and CUrlArgs_Parser::m_Flags.
Definition at line 576 of file ncbi_url.hpp.
References CUrl::m_Host, CUrl::m_IsGeneric, and CUrl::m_Service.
Referenced by CHttpSessionApp::Run().
Definition at line 70 of file ncbi_applog_url.hpp.
References CApplogUrl::m_Session, and rapidjson::value.
Referenced by CNcbiApplogApp::Run().
|
inline |
Definition at line 66 of file ncbi_applog_url.hpp.
References CApplogUrl::SetThreadID_Str(), NStr::UInt8ToString(), and rapidjson::value.
Definition at line 67 of file ncbi_applog_url.hpp.
References CApplogUrl::m_TID, and rapidjson::value.
Referenced by CApplogUrl::SetThreadID().
Set value, remove any other values for the name.
Definition at line 290 of file ncbi_url.cpp.
References CUrlArgs::FindFirst(), CUrlArgs::FindNext(), CUrlArgs::m_Args, CUrlArgs::m_IsIndex, tmp, and rapidjson::value.
void CUrl::SetUrl | ( | const string & | url, |
const IUrlEncoder * | encoder = 0 |
||
) |
Parse the URL.
url | String to parse as URL |
encoder | URL encoder object. If not set, the default encoder will be used. |
Definition at line 409 of file ncbi_url.cpp.
References _ASSERT, NStr::eNocase, NStr::EqualNocase(), NStr::eReverseSearch, NStr::Find(), CUrl::GetDefaultEncoder(), CUrl::m_ArgsList, CUrl::m_Fragment, CUrl::m_Host, CUrl::m_IsGeneric, CUrl::m_OrigArgs, CUrl::m_Password, CUrl::m_Path, CUrl::m_Port, CUrl::m_Scheme, CUrl::m_Service, CUrl::m_User, NCBI_SCHEME_SERVICE, NCBI_THROW2, NPOS, offset, CUrl::x_IsHostPort(), CUrl::x_SetArgs(), CUrl::x_SetFragment(), CUrl::x_SetHost(), CUrl::x_SetPassword(), CUrl::x_SetPath(), CUrl::x_SetPort(), CUrl::x_SetScheme(), CUrl::x_SetService(), and CUrl::x_SetUser().
Referenced by CSDB_ConnectionParam::CSDB_ConnectionParam(), CCgiContext::GetSelfURL(), CHttpSessionApp::Run(), and CHttpRequest::sx_Adjust().
Definition at line 406 of file ncbi_url.hpp.
References CUrl::m_User, and rapidjson::value.
Referenced by CSDB_ConnectionParam::Set().
Set new value for the first argument with the given name or add a new argument.
Definition at line 270 of file ncbi_url.cpp.
References CUrlArgs::FindFirst(), CUrlArgs::m_Args, CUrlArgs::m_IsIndex, and rapidjson::value.
Referenced by SItemTypeAndReason::Get(), CHttpSessionApp::Run(), CSDB_ConnectionParam::Set(), and CHttpFormData::WriteFormData().
Definition at line 270 of file ncbi_url.hpp.
|
private |
Definition at line 315 of file ncbi_url.cpp.
References NStr::Equal(), CUrlArgs::m_Args, and CUrlArgs::m_Case.
|
private |
Definition at line 303 of file ncbi_url.cpp.
References NStr::Equal(), CUrlArgs::m_Args, and CUrlArgs::m_Case.
Referenced by CUrlArgs::FindFirst(), and CUrlArgs::FindNext().
|
private |
Definition at line 375 of file ncbi_url.cpp.
References NPOS, NStr::ToLower(), CUrl::x_SetHost(), and CUrl::x_SetPort().
Referenced by CUrl::SetUrl().
|
inlineprivate |
Definition at line 641 of file ncbi_url.hpp.
References CUrl::m_ArgsList, and CUrl::m_OrigArgs.
Referenced by CUrl::GetArgs(), and CUrl::SetUrl().
|
inlineprivate |
Definition at line 634 of file ncbi_url.hpp.
References IUrlEncoder::DecodeFragment(), and CUrl::m_Fragment.
Referenced by CUrl::SetUrl().
|
inlineprivate |
Definition at line 605 of file ncbi_url.hpp.
References CUrl::m_Host, and CUrl::m_Service.
Referenced by CUrl::SetUrl(), and CUrl::x_IsHostPort().
|
private |
Definition at line 57 of file ncbi_url.cpp.
References _ASSERT, CUrlArgs_Parser::AddArgument(), IUrlEncoder::DecodeArgName(), CUrlArgs_Parser::eArg_Index, kEmptyStr, len, NPOS, and query.
Referenced by CUrlArgs_Parser::SetQueryString().
|
inlineprivate |
Definition at line 598 of file ncbi_url.hpp.
References IUrlEncoder::DecodePassword(), and CUrl::m_Password.
Referenced by CUrl::SetUrl().
|
inlineprivate |
Definition at line 627 of file ncbi_url.hpp.
References IUrlEncoder::DecodePath(), and CUrl::m_Path.
Referenced by CUrl::SetUrl().
|
inlineprivate |
Definition at line 619 of file ncbi_url.hpp.
References CUrl::m_Port, and NStr::StringToInt().
Referenced by CUrl::SetUrl(), and CUrl::x_IsHostPort().
|
inlineprivate |
Definition at line 584 of file ncbi_url.hpp.
References CUrl::m_Scheme.
Referenced by CUrl::SetUrl().
Definition at line 613 of file ncbi_url.hpp.
References CUrl::m_Service, and NStr::URLDecode().
Referenced by CUrl::SetScheme(), and CUrl::SetUrl().
|
inlineprivate |
Definition at line 591 of file ncbi_url.hpp.
References IUrlEncoder::DecodeUser(), and CUrl::m_User.
Referenced by CUrl::SetUrl().
|
inlinevirtual |
Definition at line 183 of file ncbi_url.hpp.
|
inlinevirtual |
Definition at line 59 of file ncbi_url.hpp.
|
private |
Definition at line 87 of file ncbi_applog_url.hpp.
Referenced by CApplogUrl::ComposeUrl(), and CApplogUrl::SetAppName().
|
private |
Definition at line 339 of file ncbi_url.hpp.
Referenced by CUrlArgs::AddArgument(), CUrlArgs::AddValue(), CUrlArgs::clear(), CUrlArgs::FindFirst(), CUrlArgs::GetArgs(), CUrlArgs::GetQueryString(), CUrlArgs::GetValue(), CUrlArgs::IsSetValue(), CUrlArgs::SetUniqueValue(), CUrlArgs::SetValue(), and CUrlArgs::x_Find().
|
private |
Definition at line 499 of file ncbi_url.hpp.
Referenced by CUrl::Adjust(), CUrl::ComposeUrl(), CUrl::GetArgs(), CUrl::HaveArgs(), CUrl::operator=(), CUrl::SetUrl(), and CUrl::x_SetArgs().
|
private |
Definition at line 337 of file ncbi_url.hpp.
Referenced by CUrlArgs::SetCase(), and CUrlArgs::x_Find().
|
private |
Definition at line 94 of file ncbi_applog_url.hpp.
Referenced by CApplogUrl::ComposeUrl(), and CApplogUrl::SetClient().
|
private |
Definition at line 157 of file ncbi_url.hpp.
Referenced by CDefaultUrlEncoder::DecodeArgName(), CDefaultUrlEncoder::DecodeArgValue(), CDefaultUrlEncoder::EncodeArgName(), and CDefaultUrlEncoder::EncodeArgValue().
|
protected |
Definition at line 224 of file ncbi_url.hpp.
Referenced by CCgiEntries_Parser::AddArgument(), CUrlArgs_Parser::SetQueryString(), and CUrlArgs_Parser::SetSemicolonIsNotArgDelimiter().
|
private |
Definition at line 497 of file ncbi_url.hpp.
Referenced by CUrl::Adjust(), CUrl::ComposeUrl(), CUrl::GetFragment(), CUrl::operator=(), CUrl::SetFragment(), CUrl::SetUrl(), and CUrl::x_SetFragment().
|
private |
Definition at line 493 of file ncbi_url.hpp.
Referenced by CUrl::ComposeUrl(), CUrl::GetHost(), CUrl::IsEmpty(), CUrl::operator=(), CUrl::SetHost(), CUrl::SetService(), CUrl::SetUrl(), and CUrl::x_SetHost().
|
private |
Definition at line 88 of file ncbi_applog_url.hpp.
Referenced by CApplogUrl::ComposeUrl(), and CApplogUrl::SetHost().
|
private |
Definition at line 490 of file ncbi_url.hpp.
Referenced by CUrl::ComposeUrl(), CUrl::GetIsGeneric(), CUrl::operator=(), CUrl::SetIsGeneric(), CUrl::SetService(), and CUrl::SetUrl().
|
private |
Definition at line 338 of file ncbi_url.hpp.
Referenced by CUrlArgs::AddArgument(), CUrlArgs::AddValue(), CUrlArgs::clear(), SPSG_ArgsBase::CUrlArgs(), CUrlArgs::SetUniqueValue(), and CUrlArgs::SetValue().
|
private |
Definition at line 95 of file ncbi_applog_url.hpp.
Referenced by CApplogUrl::ComposeUrl(), and CApplogUrl::SetLogsite().
|
private |
Definition at line 498 of file ncbi_url.hpp.
Referenced by CUrl::Adjust(), CUrl::GetOriginalArgsString(), CUrl::operator=(), CUrl::SetUrl(), and CUrl::x_SetArgs().
|
private |
Definition at line 492 of file ncbi_url.hpp.
Referenced by CUrl::Adjust(), CUrl::ComposeUrl(), CUrl::GetPassword(), CUrl::operator=(), CUrl::SetPassword(), CUrl::SetUrl(), and CUrl::x_SetPassword().
|
private |
Definition at line 496 of file ncbi_url.hpp.
Referenced by CUrl::Adjust(), CUrl::ComposeUrl(), CUrl::GetPath(), CUrl::IsEmpty(), CUrl::operator=(), CUrl::SetPath(), CUrl::SetUrl(), and CUrl::x_SetPath().
|
private |
Definition at line 92 of file ncbi_applog_url.hpp.
Referenced by CApplogUrl::ComposeUrl(), and CApplogUrl::SetHitID().
|
private |
Definition at line 89 of file ncbi_applog_url.hpp.
Referenced by CApplogUrl::ComposeUrl(), and CApplogUrl::SetProcessID_Str().
|
private |
Definition at line 495 of file ncbi_url.hpp.
Referenced by CUrl::ComposeUrl(), CUrl::GetPort(), CUrl::operator=(), CUrl::SetPort(), CUrl::SetUrl(), and CUrl::x_SetPort().
|
private |
Definition at line 91 of file ncbi_applog_url.hpp.
Referenced by CApplogUrl::ComposeUrl(), and CApplogUrl::SetRequestID_Str().
|
private |
Definition at line 489 of file ncbi_url.hpp.
Referenced by CUrl::Adjust(), CUrl::ComposeUrl(), CUrl::GetScheme(), CUrl::operator=(), CUrl::SetScheme(), CUrl::SetUrl(), and CUrl::x_SetScheme().
|
private |
Definition at line 494 of file ncbi_url.hpp.
Referenced by CUrl::ComposeUrl(), CUrl::GetService(), CUrl::IsService(), CUrl::operator=(), CUrl::SetHost(), CUrl::SetService(), CUrl::SetUrl(), CUrl::x_SetHost(), and CUrl::x_SetService().
|
private |
Definition at line 93 of file ncbi_applog_url.hpp.
Referenced by CApplogUrl::ComposeUrl(), and CApplogUrl::SetSession().
|
private |
Definition at line 90 of file ncbi_applog_url.hpp.
Referenced by CApplogUrl::ComposeUrl(), and CApplogUrl::SetThreadID_Str().
|
private |
Current local time if empty.
Definition at line 98 of file ncbi_applog_url.hpp.
Referenced by CApplogUrl::ComposeUrl(), and CApplogUrl::SetDateTime().
|
private |
Definition at line 97 of file ncbi_applog_url.hpp.
Referenced by CApplogUrl::ComposeUrl(), and CApplogUrl::SetDateTime().
|
private |
Base Applog URL, use default if empty.
Definition at line 84 of file ncbi_applog_url.hpp.
Referenced by CApplogUrl::ComposeUrl().
|
private |
Definition at line 491 of file ncbi_url.hpp.
Referenced by CUrl::Adjust(), CUrl::ComposeUrl(), CUrl::GetUser(), CUrl::operator=(), CUrl::SetUrl(), CUrl::SetUser(), and CUrl::x_SetUser().
string CUrlArgs::SUrlArg::name |
Definition at line 272 of file ncbi_url.hpp.
Referenced by SPSG_Args::GetValue().
string CUrlArgs::SUrlArg::value |
Definition at line 273 of file ncbi_url.hpp.