& id2_info,
46m_Sat(0), m_Info(0), m_Chunks(0),
47m_SplitVersion(0), m_SplitVersionPresent(
false)
56 if(parts.size() < 3) {
58app->GetCounters().Increment(
nullptr,
61 "Invalid id2 info '"+ id2_info +
62 "'. Expected 3 or more parts, found "+
63to_string(parts.size()) +
" parts.");
71 if(parts.size() >= 4) {
77app->GetCounters().Increment(
nullptr,
80 "Invalid id2 info '"+ id2_info +
81 "'. Cannot convert parts into integers.");
86 stringvalidate_message;
88validate_message =
"Invalid id2 info SAT value. " 89 "Expected to be > 0. Received: "+
90to_string(
m_Sat) +
".";
93 if(!validate_message.empty())
94validate_message +=
" ";
95validate_message +=
"Invalid id2 info INFO value. " 96 "Expected to be > 0. Received: "+
97to_string(
m_Info) +
".";
100 if(!validate_message.empty())
101validate_message +=
" ";
102validate_message +=
"Invalid id2 info NCHUNKS value. " 103 "Expected to be > 0. Received: "+
107 if(!validate_message.empty()) {
109app->GetCounters().Increment(
nullptr,
152 const string& id2_info) :
153m_LastModified(0), m_SplitVersion(0),
154m_LastModifiedPresent(
false), m_SplitVersionPresent(
false)
161 if(parts.size() < 2) {
163 "Invalid id2_info parameter value '"+ id2_info +
165 " separated) parts, found "+
166to_string(parts.size()) +
" parts.");
169 if(parts.front() !=
kPrefix) {
171 "Invalid id2_info parameter value '"+ id2_info +
178 booltse_id_found =
false;
179 for(
const auto& part : parts) {
180 if(part.find(
kTseId) == 0) {
184 "Invalid id2 info part '"+ part +
185 "'. Cannot convert the part value " 186 "into a pair '<sat>.<sat_key>'.");
188tse_id_found =
true;
198 "Invalid id2 info part '"+ part +
199 "'. Cannot convert the part value into an integer.");
210 "Invalid id2 info part '"+ part +
211 "'. Cannot convert the part value into an integer.");
217 "Invalid id2_info parameter value '"+ id2_info +
218 "'. The part '"+ part +
"' is not recognized.");
221 if(tse_id_found ==
false) {
223 "Invalid id2_info parameter value '"+ id2_info +
224 "'. The mandatory part '"+
kTseId+
"' is not found.");
@ ePSGS_InvalidId2InfoError
CPSGS_IdModifiedVerFlavorId2Info()
TLastModified m_LastModified
bool m_LastModifiedPresent
bool m_SplitVersionPresent
string Serialize(void) const
TSplitVersion m_SplitVersion
string Serialize(void) const
CPSGS_SatInfoChunksVerFlavorId2Info()
TSplitVersion m_SplitVersion
bool m_SplitVersionPresent
static CPubseqGatewayApp * GetInstance(void)
Include a standard set of the NCBI C++ Toolkit most basic headers.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message 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.
@ fSplit_ByPattern
Require full delimiter strings.
static string kTseLastModified
static string kTseSplitVersion
long PSGToString(long signed_value, char *buf)
string ToString(void) const
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