list<CStructComment>& comments,
87 const autonumCols = cols.size();
89 while(!reader.
AtEOF())
94 if(current.
empty())
98vector<CTempString> values;
101 if(values[0].
empty()) {
105 if(values.size() > numCols) {
106 string msg{
"Number of values exceeds number of columns."};
118 returncomments.size();
128 while(! reader.
AtEOF()) {
132 if(current.
empty())
150 auto& user = desc.
GetUser();
151 if(user.IsSetType() && user.GetType().IsStr() &&
NStr::Equal(user.GetType().GetStr(),
"StructuredComment"))
153 if(user.IsSetData() && user.GetData().size() > 0)
155 const auto& fdata = *user.
GetData().front();
156 if(fdata.IsSetLabel() && fdata.GetLabel().IsStr() &&
NStr::Equal(fdata.GetLabel().GetStr(),
"StructuredCommentPrefix"))
157 returnfdata.GetData().GetStr();
168unique_ptr<CLineErrorEx> pMsg{
182 if(name.
compare(
"StructuredCommentPrefix") == 0)
189user_obj = &(user_desc->
SetUser());
190user_obj->
SetType().SetStr(
"StructuredComment");
191cmt.
m_descs.push_back(user_desc);
195 if(name.
compare(
"StructuredCommentSuffix") == 0)
203cmt.
m_descs.reserve(values.size() - 1);
206 for(
size_t i= 1;
i<values.size();
i++)
208 if(!values[
i].
empty())
220 while(!reader.
AtEOF() && cols.empty())
251 return(pTsid->
GetName() == commentIdText);
257 switch(seqID.
Which()) {
271 if(general.IsSetTag()) {
272 if(general.GetTag().IsStr()) {
300 unsigned charchain =
static_cast<unsigned char>(pid.
GetChain());
303seqIdText +=
static_cast<char>(chain);
309 return(seqIdText == commentIdText);
User-defined methods of the data storage class.
static CLineErrorEx * Create(EProblem eProblem, EDiagSev eSeverity, int code, int subcode, const std::string &strSeqId, unsigned int uLine, const std::string &strErrorMessage=string(""), const std::string &strFeatureName=string(""), const std::string &strQualifierName=string(""), const std::string &strQualifierValue=string(""), const TVecOfLines &vecOfOtherLines=TVecOfLines())
Use this because the constructor is protected.
CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...
CUser_object & AddField(const string &label, const string &value, EParseField parse=eParse_String)
add a data field to the user object that holds a given value
@ eProblem_GeneralParsingError
Abstract base class for lightweight line-by-line reading.
#define ERR_POST_X(err_subcode, message)
Error posting with default error code and given error subcode.
EDiagSev
Severity level for the posted diagnostics.
@ eDiag_Error
Error message.
const TPrim & Get(void) const
CTempString GetCurrentLine(void) const
virtual Uint8 GetLineNumber(void) const =0
Returns the current line number (counting from 1, not 0).
virtual bool AtEOF(void) const =0
Indicates (negatively) whether there is any more input.
const CTextseq_id * GetTextseq_Id(void) const
Return embedded CTextseq_id, if any.
E_SIC Compare(const CSeq_id &sid2) const
Compare() - more general.
@ e_YES
SeqIds compared, but are different.
void Reset(void)
Reset reference object.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
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 string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
bool empty(void) const
Return true if the represented string is empty (i.e., the length is zero)
int compare(const CTempString str) const
Compare the current string with a given string.
static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)
Check if a string starts with a specified prefix value.
static bool SplitInTwo(const CTempString str, const CTempString delim, string &str1, string &str2, TSplitFlags flags=0)
Split a string into two pieces using the specified delimiters.
static enable_if< is_arithmetic< TNumeric >::value||is_convertible< TNumeric, Int8 >::value, string >::type NumericToString(TNumeric value, TNumToStringFlags flags=0, int base=10)
Convert numeric value to string.
static bool Equal(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2, ECase use_case=eCase)
Test for equality of a substring with another string.
bool IsNumber(void) const
Check if variant Number is selected.
const TId & GetId(void) const
Get the Id member data.
const TNumber & GetNumber(void) const
Get the variant data.
const TApp_number & GetApp_number(void) const
Get the variant data.
const TTag & GetTag(void) const
Get the Tag member data.
const TStr & GetStr(void) const
Get the variant data.
const TData & GetData(void) const
Get the Data member data.
void SetType(TType &value)
Assign a value to Type data member.
TChain GetChain(void) const
Get the Chain member data.
const TPdb & GetPdb(void) const
Get the variant data.
TGibbsq GetGibbsq(void) const
Get the variant data.
TId GetId(void) const
Get the Id member data.
bool IsSetChain_id(void) const
chain identifier; length-independent generalization of 'chain' Check if a value has been assigned to ...
bool IsSetChain(void) const
Deprecated: 'chain' can't support multiple character PDB chain identifiers (introduced in 2015).
bool IsSetAccession(void) const
Check if a value has been assigned to Accession data member.
const TName & GetName(void) const
Get the Name member data.
E_Choice Which(void) const
Which variant is currently selected.
TGi GetGi(void) const
Get the variant data.
const TMol & GetMol(void) const
Get the Mol member data.
TSeqid GetSeqid(void) const
Get the Seqid member data.
const TGiim & GetGiim(void) const
Get the variant data.
const TLocal & GetLocal(void) const
Get the variant data.
bool IsLocal(void) const
Check if variant Local is selected.
const TChain_id & GetChain_id(void) const
Get the Chain_id member data.
const TGeneral & GetGeneral(void) const
Get the variant data.
const TPatent & GetPatent(void) const
Get the variant data.
TGibbmt GetGibbmt(void) const
Get the variant data.
const TCit & GetCit(void) const
Get the Cit member data.
bool IsSetName(void) const
Check if a value has been assigned to Name data member.
const TAccession & GetAccession(void) const
Get the Accession member data.
@ e_Gibbmt
Geninfo backbone moltype.
@ e_Giim
Geninfo import id.
@ e_Gibbsq
Geninfo backbone seqid.
@ e_General
for other databases
@ e_Gi
GenInfo Integrated Database.
const TUser & GetUser(void) const
Get the variant data.
TUser & SetUser(void)
Select the variant.
bool IsUser(void) const
Check if variant User is selected.
Lightweight interface for getting lines of data with minimal memory copying.
constexpr bool empty(list< Ts... >) noexcept
const GenericPointer< typename T::ValueType > T2 value
static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
NCBI_DEFINE_ERR_SUBCODE_X(1)
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