A RetroSearch Logo

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

Search Query:

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

NCBI C++ ToolKit: src/app/pubseq_gateway/server/url_param_utils.cpp Source File

45

&

value

, &value_size);

52 static string kYes

=

"yes"

;

53 static string kNo

=

"no"

;

55  "' and '"

+

kNo

+

"'."

;

59  string

& err_msg)

const 61  if

(param_value !=

kYes

&& param_value !=

kNo

) {

62

err_msg =

"Malformed '"

+ param_name +

"' parameter. "

+

kBoolAcceptable

;

72  string

& err_msg)

const 77

err_msg =

"Error converting '"

+ param_name +

"' parameter " 78  "to integer (received value: '"

+

89  string

& err_msg)

const 94

err_msg =

"Error converting '"

+ param_name +

"' parameter " 95  "to integer (received value: '"

+

106  string

& err_msg)

const 111

err_msg =

"Error converting '"

+ param_name +

"' parameter " 112  "to double (received value: '"

+

121

shared_ptr<CPSGS_Reply> reply,

123  const string

& err_msg)

135

shared_ptr<CPSGS_Reply> reply,

137  const string

& err_msg)

152  const string

& err_msg)

165

shared_ptr<CPSGS_Reply> reply,

172  if

(trace_protocol_param.

m_Found

) {

176

trace_protocol_param.

m_Value

, err_msg)) {

193

shared_ptr<CPSGS_Reply> reply,

195  bool

& processor_events)

197

processor_events =

false

;

200  if

(processor_events_param.

m_Found

) {

204

processor_events_param.

m_Value

, err_msg)) {

208

processor_events = processor_events_param.

m_Value

==

kYes

;

218

shared_ptr<CPSGS_Reply> reply,

220

optional<bool> & include_hup)

224  if

(include_hup_param.

m_Found

) {

228

include_hup_param.

m_Value

, err_msg)) {

244

shared_ptr<CPSGS_Reply> reply,

246  double

& resend_timeout)

251  if

(resend_timeout_param.

m_Found

) {

254

resend_timeout_param.

m_Value

,

255

resend_timeout, err_msg)) {

260  if

(resend_timeout < 0.0) {

262

to_string(resend_timeout) +

". It must be >= 0.0"

;

275

shared_ptr<CPSGS_Reply> reply,

277  bool

& seq_id_resolve)

279

seq_id_resolve =

true

;

282  if

(seq_id_resolve_param.

m_Found

) {

285

seq_id_resolve_param.

m_Value

, err_msg)) {

289

seq_id_resolve = seq_id_resolve_param.

m_Value

==

kYes

;

299

shared_ptr<CPSGS_Reply> reply,

315

err_msg =

"Invalid '"

+

kHopsParam

+

"' parameter value "

+

316

to_string(hops) +

". It must be > 0."

;

322

err_msg =

"The '"

+

kHopsParam

+

"' parameter value "

+ to_string(hops) +

323  " exceeds the server configured value "

+

342

shared_ptr<CPSGS_Reply> reply,

349  if

(last_modified_param.

m_Found

) {

352

last_modified, err_msg)) {

363  "' parameter is not found."

;

365  "' parameter value has not been supplied"

;

369

shared_ptr<CPSGS_Reply> reply,

374  if

(!blob_id_param.

m_Found

) {

380  if

(blob_id.

GetId

().empty()) {

388 static

vector<pair<string, SPSGS_ResolveRequest::EPSGS_BioseqIncludeData>>

409

shared_ptr<CPSGS_Reply> reply,

413

include_data_flags = 0;

417

request_param =

x_GetParam

(req, flag_param.first);

421

request_param.

m_Value

, err_msg)) {

425  if

(request_param.

m_Value

==

"yes"

) {

426

include_data_flags |= flag_param.second;

428

include_data_flags &= ~flag_param.second;

442

shared_ptr<CPSGS_Reply> reply,

453

id2_info = id2_info_param.

m_Value

;

460  "' parameter is not found."

;

462  "' parameter value. It must be >= 0"

;

466

shared_ptr<CPSGS_Reply> reply,

472  if

(!id2_chunk_param.

m_Found

) {

479

id2_chunk_param.

m_Value

, id2_chunk, err_msg)) {

500  if

(exclude_blobs_param.

m_Found

) {

501

vector<string> blob_ids;

504  size_t

empty_count = 0;

505  for

(

const auto

& item : blob_ids) {

513  PSG_WARNING

(

"Found "

<< empty_count <<

" empty blob id(s) in the '"

<<

527

shared_ptr<CPSGS_Reply> reply,

529

vector<string> & enabled_processors,

530

vector<string> & disabled_processors)

537

disabled_processors);

539

enabled_processors.erase(

540  remove_if

(enabled_processors.begin(), enabled_processors.end(),

541

[](

string const

& s) { return s.empty(); }),

542

enabled_processors.end());

543

disabled_processors.erase(

544  remove_if

(disabled_processors.begin(), disabled_processors.end(),

545

[](

string const

& s) { return s.empty(); }),

546

disabled_processors.end());

548  for

(

const auto

& en_processor : enabled_processors) {

549  for

(

const auto

& dis_processor : disabled_processors) {

552  "The same processor name is found " 579

shared_ptr<CPSGS_Reply> reply,

628

shared_ptr<CPSGS_Reply> reply,

658  "' and '"

+

kJson

+

"'"

;

697

shared_ptr<CPSGS_Reply> reply,

727

shared_ptr<CPSGS_Reply> reply,

734  if

(use_cache_param.

m_Found

) {

737

use_cache_param.

m_Value

, err_msg)) {

742  if

(use_cache_param.

m_Value

==

"yes"

) {

754  "' parameter value. It must be an integer >= 0"

;

758

shared_ptr<CPSGS_Reply> reply,

760  int

& send_blob_if_small)

762

send_blob_if_small = 0;

765  if

(send_blob_if_small_param.

m_Found

) {

768

send_blob_if_small_param.

m_Value

,

769

send_blob_if_small, err_msg)) {

774  if

(send_blob_if_small < 0) {

785  "' parameter is not found"

;

790

shared_ptr<CPSGS_Reply> reply,

792

vector<string> &

names

)

802

vector<string> raw_names;

806  for

(

const auto

& raw_item : raw_names) {

807  if

(!raw_item.empty()) {

810  " is found in the list of names more than once " 811  "(case sensitive). The duplicates are ignored."

);

813  names

.push_back(raw_item);

818  if

(

names

.empty()) {

829

shared_ptr<CPSGS_Reply> reply,

833

vector<string> & enabled_processors,

834

vector<string> & disabled_processors,

835  bool

& processor_events)

843  if

(!

x_GetHops

(req, reply, now, hops)) {

847

enabled_processors.clear();

848

disabled_processors.clear();

850

disabled_processors)) {

854

processor_events =

false

;

869  "' value must be >= 0 and < "

+

874

shared_ptr<CPSGS_Reply> reply,

879  bool

seq_id_is_optional)

886  if

(!seq_id_is_optional) {

892  if

(!seq_id_is_optional) {

900

seq_id = seq_id_param.

m_Value

;

910  if

(seq_id_type_param.

m_Found

) {

913

seq_id_type, err_msg)) {

934

shared_ptr<CPSGS_Reply> reply,

936

optional<string> & protein)

943

protein = protein_param.

m_Value

;

954

shared_ptr<CPSGS_Reply> reply,

983

shared_ptr<CPSGS_Reply> reply,

985

optional<string> & nucleotide)

988  if

(nucleotide_param.

m_Found

) {

992

nucleotide = nucleotide_param.

m_Value

;

1013

shared_ptr<CPSGS_Reply> reply,

1015

optional<CSeq_id::ESNPScaleLimit> & snp_scale_limit)

1018  if

(snp_scale_limit_param.

m_Found

) {

1059

shared_ptr<CPSGS_Reply> reply,

1061

vector<pair<int, int>> & time_series)

1064  if

(time_series_param.

m_Found

) {

1065

time_series.clear();

1069  "' parameter is empty. Expected at leas one " 1070  "space separated pair of integers " 1071  "<aggregation mins>:<last minute> or 'no'"

);

1075  if

(time_series_param.

m_Value

==

"no"

) {

1084

vector<string> parts;

1086  for

(

auto

& item : parts) {

1089  "' parameter is malformed. Another item is found " 1090  "after the one which describes the rest " 1091  "of the time series."

);

1096

vector<string> vals;

1098  if

(vals.size() != 2) {

1100  "' parameter is malformed. One or more items " 1101  "do not have a second value."

);

1110  "' parameter is malformed. Cannot convert one or more " 1111  "aggregation mins into an integer"

);

1114  if

(aggregation <= 0) {

1116  "' paremeter is malformed. One or more " 1117  "aggregation mins is <= 0 while it must be > 0."

);

1122  if

(vals[1].

empty

()) {

1130  "' parameter is malformed. Cannot convert one or more " 1131  "last minute into an integer"

);

1135  if

(last_minute <= previous) {

1137  "' parameter is malformed. One or more last minute " 1138  "<= than the previous one"

);

1144  if

(previous != -1) {

1145

start = previous + 1;

1147  if

((last_minute - start + 1) % aggregation != 0) {

1149  "' parameter is malformed. The range "

+

1150

to_string(start) +

"-"

+

1151

to_string(last_minute) +

1152  " is not divisable by aggregation of "

+

1153

to_string(aggregation));

1157

previous = last_minute;

1160

time_series.push_back(make_pair(aggregation, last_minute));

1165  "' parameter is malformed. The item which descibes the " 1166  "rest of the series is not found."

);

1183

shared_ptr<CPSGS_Reply> reply,

1200

shared_ptr<CPSGS_Reply> reply,

1202

vector<string> & exclude_checks)

1208

exclude_checks.erase(

1209  remove_if

(exclude_checks.begin(), exclude_checks.end(),

1210

[](

string const

& s) { return s.empty(); }),

1211

exclude_checks.end());

1221  "' parameter is not found."

;

1223  "' parameter cannot be empty."

;

1225  "' parameter cannot contain whitespace characters."

;

1228

shared_ptr<CPSGS_Reply> reply,

1236  if

(peer_id_param.

m_Found

) {

1237

peer_id = peer_id_param.

m_Value

;

1238  if

(!peer_id.empty()) {

1240  if

(char_pos == string::npos) {

1255

reply->SetContentLength(err_msg.size());

1256

reply->Send400(err_msg.c_str());

1264  "' parameter is not found."

;

1266  "' parameter cannot be empty."

;

1268  "' parameter cannot contain " 1269  "whitespace characters."

;

1271

shared_ptr<CPSGS_Reply> reply,

1273  string

& peer_user_agent)

1275

peer_user_agent =

""

;

1279  if

(peer_user_agent_param.

m_Found

) {

1280

peer_user_agent = peer_user_agent_param.

m_Value

;

1281  if

(!peer_user_agent.empty()) {

1283  if

(char_pos == string::npos) {

1298

reply->SetContentLength(err_msg.size());

1299

reply->Send400(err_msg.c_str());

void remove_if(Container &c, Predicate *__pred)

bool GetParam(const char *name, size_t len, const char **value, size_t *value_len)

bool GetMultipleValuesParam(const char *name, size_t len, vector< string > &values)

@ ePSGS_MaxHopsExceededError

@ ePSGS_NonProtocolRequests

void x_Finish500(shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, EPSGS_PubseqGatewayErrorCode code, const string &err_msg)

bool x_GetAccessionSubstitutionOption(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, SPSGS_RequestBase::EPSGS_AccSubstitutioOption &acc_subst_option)

bool x_GetIPG(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, int64_t &ipg)

bool x_GetPeerUserAgentParameter(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, string &peer_user_agent)

bool x_GetExcludeChecks(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, vector< string > &exclude_checks)

bool x_GetId2Info(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, string &id2_info)

bool x_IsBoolParamValid(const string &param_name, const CTempString &param_value, string &err_msg) const

void x_MalformedArguments(shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, const string &err_msg)

bool x_GetIntrospectionFormat(CHttpRequest &req, string &fmt, string &err_msg)

bool x_GetLastModified(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, int64_t &last_modified)

bool x_GetHops(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, int &hops)

bool x_GetIncludeHUPParameter(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, optional< bool > &include_hup)

bool x_GetNames(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, vector< string > &names)

void x_InsufficientArguments(shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, const string &err_msg)

bool x_GetTSEOption(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, SPSGS_BlobRequestBase::EPSGS_TSEOption &tse_option)

SPubseqGatewaySettings m_Settings

bool x_GetSeqIdResolveParameter(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, bool &auto_blob_skipping)

bool x_GetProcessorEventsParameter(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, bool &processor_events)

bool x_GetNucleotide(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, optional< string > &nucleotide)

bool x_GetSNPScaleLimit(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, optional< CSeq_id::ESNPScaleLimit > &snp_scale_limit)

bool x_ProcessCommonGetAndResolveParams(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, CTempString &seq_id, int &seq_id_type, SPSGS_RequestBase::EPSGS_CacheAndDbUse &use_cache, bool seq_id_is_optional=false)

bool x_GetResendTimeout(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, double &resend_timeout)

bool x_GetEnabledAndDisabledProcessors(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, vector< string > &enabled_processors, vector< string > &disabled_processors)

void x_SendMessageAndCompletionChunks(shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, const string &message, CRequestStatus::ECode status, int code, EDiagSev severity)

bool x_GetResolveFlags(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, SPSGS_ResolveRequest::TPSGS_BioseqIncludeData &include_data_flags)

unique_ptr< CPSGSCounters > m_Counters

bool x_GetPeerIdParameter(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, string &peer_id)

bool x_GetCommonIDRequestParams(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, SPSGS_RequestBase::EPSGS_Trace &trace, int &hops, vector< string > &enabled_processors, vector< string > &disabled_processors, bool &processor_events)

bool x_GetOutputFormat(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, SPSGS_ResolveRequest::EPSGS_OutputFormat &output_format)

bool x_ConvertIntParameter(const string &param_name, const CTempString &param_value, int &converted, string &err_msg) const

SRequestParameter x_GetParam(CHttpRequest &req, const string &name) const

vector< string > x_GetExcludeBlobs(CHttpRequest &req) const

bool x_GetTimeSeries(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, vector< pair< int, int >> &time_series)

bool x_GetId2Chunk(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, int64_t &id2_chunk)

bool x_GetVerboseParameter(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, bool &verbose)

bool x_GetTraceParameter(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, SPSGS_RequestBase::EPSGS_Trace &trace)

bool x_GetBlobId(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, SPSGS_BlobId &blob_id)

bool x_ConvertDoubleParameter(const string &param_name, const CTempString &param_value, double &converted, string &err_msg) const

bool x_GetUseCacheParameter(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, SPSGS_RequestBase::EPSGS_CacheAndDbUse &use_cache)

bool x_GetProtein(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, optional< string > &protein)

bool x_GetSendBlobIfSmallParameter(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, int &send_blob_if_small)

CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...

static const struct name_t names[]

static DLIST_TYPE *DLIST_NAME() last(DLIST_LIST_TYPE *list)

@ eDiag_Error

Error message.

@ e500_InternalServerError

@ eSNPScaleLimit_Supercontig

@ eSNPScaleLimit_Chromosome

static int CompareNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)

Case-insensitive compare of a substring with another string.

static int StringToInt(const CTempString str, TStringToNumFlags flags=0, int base=10)

Convert string to int.

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

Split a string using specified delimiters.

static double StringToDouble(const CTempStringEx str, TStringToNumFlags flags=0)

Convert string to double.

CTempString & assign(const char *src_str, size_type len)

Assign new values to the content of the a string.

bool empty(void) const

Return true if the represented string is empty (i.e., the length is zero)

static long StringToLong(const CTempString str, TStringToNumFlags flags=0, int base=10)

Convert string to long.

size_type find_first_of(const CTempString match, size_type pos=0) const

Find the first occurrence of any character in the matching string within the current string,...

@ fSplit_Tokenize

All delimiters are merged and trimmed, to get non-empty tokens only.

@ e_MaxChoice

== e_Named_annot_track+1

constexpr bool empty(list< Ts... >) noexcept

const GenericPointer< typename T::ValueType > T2 value

#define PSG_ERROR(message)

#define PSG_WARNING(message)

EPSGS_PubseqGatewayErrorCode

@ ePSGS_MalformedParameter

@ ePSGS_InsufficientArguments

psg_clock_t::time_point psg_time_point_t

string SanitizeInputValue(const string &input_val)

void SetId(const string &blob_id)

EPSGS_AccSubstitutioOption

@ ePSGS_LimitedAccSubstitution

@ ePSGS_DefaultAccSubstitution

@ ePSGS_NeverAccSubstitute

int TPSGS_BioseqIncludeData

double m_ResendTimeoutSec

static string kMalformedAccSubstMsg

static string kAcceptableFmt

static string kMalformedFmtMsg

static string kId2ChunkNotFoundMsg

static string kSeqIdParam

static string kPeerIdNotFoundMsg

static string kNamesParam

static string kEnableProcessor

static string kExcludeBlobsParam

static string kSeqIdResolveParam

static string kProteinParam

static string kSeqIdMissingValMsg

static string kSendBlobIfSmallInvalidMsg

static string kIPGBadValMsg

static vector< pair< string, SPSGS_ResolveRequest::EPSGS_BioseqIncludeData > > kResolveFlagParams

static string kChromosome

static string kId2ValInvalidMsg

static string kPeerIdSpaceCharsMsg

static string kPeerUserAgentSpaceCharsMsg

static string kSendBlobIfSmallParam

static string kLastModifiedParam

static string kBoolAcceptable

static string kBlobIdNotFoundMsg

static vector< pair< int, int > > kDefaultTimeSeries

static string kNeverOption

static string kTSEAcceptable

static string kNoNamesValueMsg

static string kAccSubstAcceptable

static string kLimitedOption

static string kSupercontig

static string kPeerUserAgentEmptyMsg

static string kNamesNotFoundMsg

static string kId2ChunkParam

static string kTraceParam

static string kDefaultOption

static string kAccSubstitutionParam

static string kIncludeHUPParam

static string kSeqIdMissingMsg

static string kResendTimeoutParam

static string kBlobIdValNotFoundMsg

static string kSeqIdTypeParam

static string kSNPScaleLimitParam

static string kWhitespaceChars

static string kUseCacheParam

static string kTSEMalformedMsg

static string kBlobIdParam

static string kPeerIdParam

static string kSeqIdTypeBadValMsg

static string kPeerUserAgentNotFoundMsg

static string kDisableProcessor

static string kTimeSeriesParam

static string kProcessorEventsParam

static string kNucleotideParam

static string kPeerUserAgentParam

static string kId2InfoNotFoundMsg

static string kId2InfoParam

static string kBadSNPScaleValMsg

static string kVerboseParam

static string kAcceptableIntroFmt

static string kSNPScaleacceptable

static string kPeerIdEmptyMsg


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