(
const string&s,
stringdelim, vector<string> &elems)
43 while(start < s.length())
45 size_tfinish = s.find(delim,start);
46 if(finish == string::npos) finish = s.length();
47 stringitem = s.substr(start,finish-start);
49 if(!item.empty()) elems.push_back(item);
50start = finish+delim.length();
58 if(comment.find(
"-START##") != string::npos && comment.find(
"-END##") != string::npos && comment.find(m_DelimiterNameValue) != string::npos)
61 size_te = comment.find(
"-START##");
62 size_t b= comment.rfind(
"##",e);
63 if(
b== string::npos)
b= 0;
64e += strlen(
"-START##");
65prefix = comment.substr(
b,e-
b);
68e = comment.find(
"-END##");
69 b= comment.rfind(
"##",e);
70 if(
b== string::npos)
b= 0;
71e += strlen(
"-END##");
72suffix = comment.substr(
b,e-
b);
73comment.erase(
b,string::npos);
77vector< pair<string,string> > fields;
78 s_split(comment,m_DelimiterFields,lines);
79 for(
unsigned int i=0;
i<lines.size(); ++
i)
83 s_split(lines[
i],m_DelimiterNameValue,field);
84 if(field.size() == 2)
85fields.push_back(pair<string,string>(field[0],field[1]));
86 else if(field.size() == 1)
90fields.push_back(pair<string,string>(name,field[0]));
102user.
SetType().SetStr(
"StructuredComment");
104user.
AddField(
"StructuredCommentPrefix",prefix);
105 for(
unsigned int i=0;
i<fields.size(); ++
i)
106user.
AddField(fields[
i].first,fields[
i].second);
108user.
AddField(
"StructuredCommentSuffix",suffix);
113e =
result.find(
"-START##");
115 if(
b== string::npos)
b= 0;
116e =
result.find(
"-END##");
117e += strlen(
"-END##");
130 if((*it)->IsComment())
133 stringmodified = ApplyToComment((*it)->GetComment(),composite,seh);
134 if(modified != (*it)->GetComment())
136 if(modified.empty())
145edited_object->
Assign(**it);
159ApplyToCSeq_entry (tse, **it, composite);
169m_DelimiterNameValue = delim_name_value;
170m_DelimiterFields = delim_fields;
172ApplyToCSeq_entry (tse, *(tse.GetCompleteSeq_entry()), composite);
void AddCommand(IEditCommand &command)
Base class for all serializable objects.
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
Undo/Redo interface for editing operations.
virtual void Execute(IEditCommand *command, wxWindow *window=0)=0
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
CSeq_entry_Handle GetSeq_entryHandle(CDataLoader *loader, const TBlobId &blob_id, EMissing action=eMissing_Default)
Get Seq-entry handle by its blob-id, with possible loading.
CScope & GetScope(void) const
Get scope this handle belongs to.
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
void Reset(void)
Reset reference object.
#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 & ReplaceInPlace(string &src, const string &search, const string &replace, SIZE_TYPE start_pos=0, SIZE_TYPE max_replace=0, SIZE_TYPE *num_replace=0)
Replace occurrences of a substring within a string.
void SetType(TType &value)
Assign a value to Type data member.
const TSet & GetSet(void) const
Get the variant data.
bool IsSet(void) const
Check if variant Set is selected.
TComment & SetComment(void)
Select the variant.
void Select(E_Choice index, EResetVariant reset=eDoResetVariant)
Select the requested variant if needed.
TUser & SetUser(void)
Select the variant.
@ e_User
user defined object
#define FOR_EACH_SEQENTRY_ON_SEQSET(Itr, Var)
FOR_EACH_SEQENTRY_ON_SEQSET EDIT_EACH_SEQENTRY_ON_SEQSET.
#define FOR_EACH_SEQDESC_ON_SEQENTRY(Itr, Var)
FOR_EACH_SEQDESC_ON_SEQENTRY EDIT_EACH_SEQDESC_ON_SEQENTRY.
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