& featKey,
49 const string& featLocation,
50 constvector<string>& qualLines) :
54mFeatLocation(featLocation),
55mCleanerUpper(featKey, featLocation),
90 boolthereIsMore =
false;
138 if(! cleaned.starts_with(
'/') || cleaned.starts_with(
"/ ")) {
144 autoidxEqual = cleaned.find(
'=', 1);
145 automaybeQualKey = cleaned.substr(1, idxEqual);
146 if(idxEqual != string::npos) {
147maybeQualKey.pop_back();
155qualKey = maybeQualKey;
158 if(idxEqual == string::npos) {
163 autotail = cleaned.substr(idxEqual + 1, string::npos);
172thereIsMore =
false;
175 if(! tail.starts_with(
'\"')) {
178thereIsMore = (qualKey ==
"anticodon") && ! tail.ends_with(
')');
182 if(tail.ends_with(
'\"')) {
183qualVal = tail.substr(1, tail.size() - 2);
185thereIsMore =
false;
189qualVal = tail.substr(1, string::npos);
197 const string& qualKey,
202 while(thereIsMore) {
204thereIsMore =
false;
205 if(qualKey !=
"anticodon") {
222 const string& qualKey,
231 boolthereShouldBeMore = thereIsMore;
233 if(thereShouldBeMore && qualKey !=
"anticodon") {
242 if(cleaned.ends_with(
'\"')) {
244thereIsMore =
false;
253 const string& qualKey,
254 const string& qualVal)
270 const string& qualKey,
292 stringlastDataChunkSeen;
300 if(qualData.empty() || line.empty()) {
304 if(qualKey ==
"anticodon") {
309 autosizeAlready = qualData.size();
310 if(sizeAlready < 2) {
315 if(qualData[sizeAlready - 1] ==
'-'&& qualData[sizeAlready - 2] !=
' ') {
319 if(qualData.ends_with(
"(EC") &&
'0'<= line[0] && line[0] <=
'9') {
324 if(qualData[sizeAlready - 1] ==
','&& line[0] ==
'(') {
330 autolastSeenSize = lastDataChunkSeen.size();
331 autorecentBlank = lastDataChunkSeen.find(
' ');
333 if(recentBlank != string::npos) {
336 autopendingBlank = line.find(
' ');
338 if(pendingBlank > 2) {
340}
else if(pendingBlank == 1) {
341 autosingleCharAllowed =
string(
"+-").find(line[0]);
342 if(singleCharAllowed != string::npos) {
367 const string& qualKey)
370 if(qualKey ==
"geo_loc_name") {
373 auto type= objects::CSeqFeatData::GetQualifierType(qualKey);
374 return(
type!= objects::CSeqFeatData::eQual_bad);
380 const string& qualVal)
383 intcountEscapedQuotes(0);
384 autonextEscapedQuote = qualVal.find(
"\"\"");
385 while(nextEscapedQuote != string::npos) {
386++countEscapedQuotes;
387nextEscapedQuote = qualVal.find(
"\"\"", nextEscapedQuote + 2);
389 intcountAnyQuotes(0);
390 autonextAnyQuote = qualVal.find(
"\"");
391 while(nextAnyQuote != string::npos) {
393nextAnyQuote = qualVal.find(
"\"", nextAnyQuote + 1);
395 return(0 == countEscapedQuotes % 4 &&
396countAnyQuotes == 2 * countEscapedQuotes);
static void NoTextAfterEqualSign(const string &featKey, const string &featLocation, const string &qualKey)
static void UnbalancedQuotes(const string &qualKey)
static void UnexpectedData(const string &featKey, const string &featLocation)
static void UnknownQualifierKey(const string &featKey, const string &featLocation, const string &qualKey)
EFormat
The formats are checked in the same order as declared here.
bool CleanAndValidate(string &qualKey, string &qualVal)
void xQualValAppendLine(const string &qualKey, const string &line, string &qualData)
DATA::const_iterator mCurrent
static bool sIsLegalQual(const string &qualKey)
CQualParser(Parser::EFormat fmt, const string &featKey, const string &featLocation, const vector< string > &qualLines)
CQualCleanup mCleanerUpper
bool xParseQualifierCont(const string &qualKey, string &qualVal, bool &thereIsMore)
string mLastDataChunkForKey
virtual bool GetNextQualifier(string &qualKey, string &qualVal)
bool xParseQualifierTail(const string &qualKey, string &qualVal, bool &thereIsMore)
static bool sHasBalancedQuotes(const string &qualVal)
bool xParseQualifierHead(string &qualKey, string &qualVal, bool &thereIsMore)
bool xParseQualifierStart(bool silent, string &qualKey, string &qualVal, bool &thereIsMore)
const string & mFeatLocation
const string::size_type mMaxChunkSize
string mLastKeyForDataChunk
bool xValidateSyntax(const string &qualKey, const string &qualVal)
Include a standard set of the NCBI C++ Toolkit most basic headers.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static void TruncateSpacesInPlace(string &str, ETrunc where=eTrunc_Both)
Truncate whitespace in a string (in-place)
static string TruncateSpaces(const string &str, ETrunc where=eTrunc_Both)
Truncate whitespace in a string.
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