85 descr +=
" entire text";
90 descr +=
" just after";
93 descr +=
" starting with";
100 descr +=
" 'numbers'";
103 descr +=
" 'letters'";
114 descr +=
" up to and including";
121 descr +=
" 'numbers'";
124 descr +=
" 'letters'";
171 TConstraints& constraints,
bool remove_constraint)
const
174 string resolve_fnc, var_name = path;
180 if (!resolve_fnc.empty()) {
183 }
else if (path.find(
',') !=
NPOS) {
184 vector<string> tokens;
188 var_name = tokens[1];
192 return make_pair(resolve_fnc, var_name);
200 bool remove_constraint =
true;
208 function += dest.first;
223 function +=
"(" +
source.second +
");";
227 string parsed_text =
"text";
243 parsed_fnc +=
"(" + src_field +
", ";
255 left_del =
"eDigits";
258 left_del =
"eLetters";
270 right_del =
"eDigits";
273 right_del =
"eLetters";
283 parsed_fnc +=
");\n";
295 return empty_before && empty_after;
327 x_LoadPanel(parent,
"ParseStringSourceQual", args);
345 string rt_var =
"src";
348 string src_resolve_fnc, src_var_name = path;
351 if (path.find(
',') !=
NPOS) {
352 vector<string> tokens;
358 if (!src_resolve_fnc.empty()) {
370 if (dest.find(
',') !=
NPOS) {
371 vector<string> tokens;
378 function += src_resolve_fnc;
392 if (path.find(
',') !=
NPOS) {
393 function += CMacroFunction_RemoveModifier::GetFuncName();
394 function +=
"(" + rt_var +
");";
398 function +=
"(" + src_var_name +
");";
403 string parsed_text =
"text";
439 x_LoadPanel(parent,
"ParseToStringSourceQual", args);
481 if (dest.find(
',') !=
NPOS) {
482 vector<string> tokens;
491 if (src_path ==
"localid") {
493 function = rt_var +
" = " + CMacroFunction_LocalID::GetFuncName() +
"();\n";
495 else if (src_path ==
"defline") {
498 function +=
"(\"descr..title\");\n";
539 x_LoadPanel(parent, CMacroFunction_ParseToDBLink::GetFuncName(), args);
580 if (dest.find(
',') !=
NPOS) {
581 vector<string> tokens;
590 if (src_path ==
"localid") {
592 function = rt_var +
" = " + CMacroFunction_LocalID::GetFuncName() +
"();\n";
594 else if (src_path ==
"defline") {
595 rt_var =
"\"descr..title\"";
604 function += CMacroFunction_ParseToDBLink::GetFuncName();
616 return { CMacroFunction_ParseToDBLink::GetFuncName(),
618 CMacroFunction_LocalID::GetFuncName() };
623 return { CMacroFunction_ParseToDBLink::GetFuncName() };
657 bool modified = (new_target !=
m_Target);
690 bool remove_constraint =
true;
697 if (src_path ==
"localid") {
699 function = rt_var +
" = " + CMacroFunction_LocalID::GetFuncName() +
"();\n";
700 function += dest.first;
702 else if (src_path ==
"defline") {
705 function +=
"(\"descr..title\");\n";
706 function += dest.first;
714 function += dest.first;
731 CMacroFunction_Resolve::GetFuncName(),
733 CMacroFunction_LocalID::GetFuncName(),
748 x_LoadPanel(parent,
"ParseStringProteinQual", args);
781 function += dest.first;
796 function +=
"(" +
source.second +
");";
800 string parsed_text =
"text";
816 return { CMacroFunction_Resolve::GetFuncName(),
821 CMacroFunction_UpdatemRNAProduct::GetFuncName() };
857 bool modified = (new_target !=
m_Target);
886 if (from_field.empty() || to_field.empty())
889 if ((from_field ==
"ncRNA class" || to_field ==
"ncRNA class") && !
NStr::EqualNocase(rna_type,
"ncRNA"))
892 if (from_field ==
"codons recognized")
900 string src_feat =
"rna";
905 from_field = rna_type +
" " + from_field;
908 string dest_feat =
"rna";
913 to_field = rna_type +
" " + to_field;
917 bool remove_constraint =
true;
918 string src_var =
"src";
921 if (src_feat == dest_feat && src_feat ==
"rna") {
924 if (!
source.first.empty())
926 if (!dest.first.empty())
927 function += dest.first;
940 function += CMacroFunction_RemoveRnaProduct::GetFuncName() +
"();";
944 if (!
source.first.empty()) {
948 function +=
source.second;
955 string parsed_text =
"text";
958 if (to_field ==
"tRNA codons recognized") {
959 function += CMacroFunction_SetCodonsRecognized::GetFuncName();
960 function +=
"(" + parsed_text +
");";
977 if (!
source.first.empty())
980 if (dest_path.find(
',') !=
NPOS) {
981 vector<string> tokens;
985 dest_path = tokens[1];
990 function +=
"(\"" + src_feat +
"\", " +
source.second +
", \"" + dest_feat +
"\", " + dest_path +
", ";
999 if (src_feat ==
"gene") {
1000 function += CMacroFunction_RmvRelFeatQual::GetFuncName();
1001 function +=
"(\"gene\", " +
source.second +
");";
1005 function += CMacroFunction_RemoveRnaProduct::GetFuncName() +
"();";
1009 if (!
source.first.empty()) {
1010 function += src_var;
1013 function +=
source.second;
1021 string parsed_text =
"text";
1022 if (src_feat ==
"rna") {
1025 function +=
"(" + parsed_text +
", \"" + dest_feat +
"\", " + dest_path +
", ";
1034 function +=
"(\"" + src_feat +
"\", " +
source.second +
", ";
1037 if (dest_feat ==
"rna") {
1046 else if (dest_feat ==
"gene") {
1048 function +=
"(" + parsed_text +
", \"" + dest_feat +
"\", " + dest_path +
", ";
1063 return { CMacroFunction_Resolve::GetFuncName(),
1067 CMacroFunction_RemoveRnaProduct::GetFuncName(),
1069 CMacroFunction_RmvRelFeatQual::GetFuncName(),
1073 CMacroFunction_SetCodonsRecognized::GetFuncName()};
1117 bool modified = (new_target !=
m_Target);
1141 if (src_feat != dest_feat) {
1155 if (src_feat.empty() || src_field.empty() || dest_field.empty())
return kEmptyStr;
1164 string src_var =
"src";
1167 if (src_feat == dest_feat) {
1172 if (!
source.first.empty())
1173 function +=
source.first;
1174 if (!dest.first.empty())
1175 function += dest.first;
1188 if (!
source.first.empty()) {
1189 function += src_var;
1192 function +=
source.second;
1198 string parsed_text =
"text";
1214 if (!
source.first.empty())
1215 function +=
source.first;
1217 if (dest_path.find(
',') !=
NPOS) {
1218 vector<string> tokens;
1222 dest_path = tokens[1];
1226 function +=
"(" +
source.second +
", \"" + dest_feat +
"\", \"" + dest_path +
"\", ";
1236 if (!
source.first.empty()) {
1237 function += src_var;
1240 function +=
source.second;
1246 string parsed_text =
"text";
1249 function +=
"(" + parsed_text +
", \"" + dest_feat +
"\", \"" + dest_path +
"\", ";
1262 return { CMacroFunction_Resolve::GetFuncName(),
1263 CMacroFunction_GeneQual::GetFuncName(),
1270 CMacroFunction_UpdatemRNAProduct::GetFuncName() };
1292 x_LoadPanel(parent,
"ParseStringProteinQual", args);
1308 bool modified = (new_target !=
m_Target);
1323 string src_feat, src_field;
1325 string dest_feat, dest_field;
1327 if (src_feat != dest_feat) {
1338 string src_feat, src_field;
1340 string dest_feat, dest_field;
1348 string src_var =
"src";
1351 if (src_feat == dest_feat) {
1357 if (!
source.first.empty())
1358 function +=
source.first;
1359 if (!dest.first.empty())
1360 function += dest.first;
1373 if (!
source.first.empty()) {
1374 function += src_var;
1377 function +=
source.second;
1383 string parsed_text =
"text";
1399 if (!
source.first.empty())
1400 function +=
source.first;
1402 if (dest_path.find(
',') !=
NPOS) {
1403 vector<string> tokens;
1407 dest_path = tokens[1];
1412 function +=
"(" +
source.second +
", \"" + dest_feat +
"\", \"" + dest_path +
"\", ";
1422 if (!
source.first.empty()) {
1423 function += src_var;
1426 function +=
source.second;
1432 string parsed_text =
"text";
1435 function +=
"(" + parsed_text +
", \"" + dest_feat +
"\", \"" + dest_path +
"\", ";
1448 return { CMacroFunction_Resolve::GetFuncName(),
1455 CMacroFunction_UpdatemRNAProduct::GetFuncName() };
1478 x_LoadPanel(parent,
"ParseBsrcToStructCommQual", args);
1504 descr +=
"database name";
1507 descr +=
"field names";
1524 string rt_var =
"src";
1527 string src_resolve_fnc, src_var_name = path;
1530 if (path.find(
',') !=
NPOS) {
1531 vector<string> tokens;
1537 if (!src_resolve_fnc.empty()) {
1550 function += src_resolve_fnc;
1556 function +=
"(" + src_var_name +
", " + dest;
1557 if (!dest_field_name.empty()) {
1559 function +=
", " + dest_field_name;
1569 if (path.find(
',') !=
NPOS) {
1570 function += CMacroFunction_RemoveModifier::GetFuncName();
1571 function +=
"(" + rt_var +
");";
1575 function +=
"(" + src_var_name +
");";
1580 string parsed_text =
"text";
1583 function +=
"(" + parsed_text +
", " + dest;
1584 if (!dest_field_name.empty()) {
1586 function +=
", " + dest_field_name;
EMacroFieldType m_FieldType
for actions such as appply/edit/etc.
vector< string > GetFeatureTypes(bool for_removal=false, bool to_create=false, bool include_all=false) const
vector< string > GetRNATypes() const
string GetAsnPathToFieldName(const string &field, EMacroFieldType type, const string &target=kEmptyStr)
const vector< string > & GetParseToBsrcKeywords() const
static string s_GetGUIMappedStructCommField(const string &value)
const vector< string > & GetParseToCdsGeneProtKeywords() const
vector< string > GetncRNAClassTypes(bool include_any=true) const
static CMacroEditorContext & GetInstance()
vector< string > GetFeatQualifiers() const
const vector< string > & GetBsrcKeywords() const
vector< string > GetFieldNames(EMacroFieldType type) const
virtual void x_AddParamPanel(wxWindow *parent)
CParseBsrcToStructCommTreeItemData()
virtual vector< string > GetFunctionNames() const
virtual string GetFunction(TConstraints &constraints) const
virtual const vector< string > & GetKeywords() const
virtual vector< string > GetMainFunctions() const
virtual string GetMacroDescription() const
virtual string GetFunction(TConstraints &constraints) const
virtual const vector< string > & GetKeywords() const
virtual vector< string > GetFunctionNames() const
virtual void x_AddParamPanel(wxWindow *parent)
virtual string GetFunction(TConstraints &constraints) const
virtual vector< string > GetFunctionNames() const
virtual bool UpdateTarget()
virtual string GetMacroDescription() const
CParseCdsGeneProtTreeItemdata()
virtual void x_AddParamPanel(wxWindow *parent)
virtual string GetVariables()
virtual vector< string > GetMainFunctions() const
virtual vector< string > GetFunctionNames() const
virtual string GetVariables()
virtual vector< string > GetMainFunctions() const
virtual string GetFunction(TConstraints &constraints) const
virtual string GetMacroDescription() const
virtual void x_AddParamPanel(wxWindow *parent)
virtual bool UpdateTarget()
CParseFeatQualTreeItemData()
virtual string GetMacroDescription() const
virtual void x_AddParamPanel(wxWindow *parent)
virtual string GetFunction(TConstraints &constraints) const
virtual vector< string > GetFunctionNames() const
CParseProteinQualTreeItemData()
virtual vector< string > GetFunctionNames() const
string x_GetParsedTextFunction(const string &src_field, const string &parsed_text) const
pair< string, string > x_GetResolveFuncForMultValQuals(const string &field, const string &rt_var, TConstraints &constraints, bool remove_constraint) const
virtual string GetFunction(TConstraints &constraints) const
string x_GetParsedTextDescription() const
virtual void x_AddParamPanel(wxWindow *parent)
virtual string GetVariables()
virtual vector< string > GetMainFunctions() const
pair< string, bool > m_IncludeLeft
CParseQualTreeItemData(const string &description, EMacroFieldType type)
bool x_ParseEntireText() const
virtual string GetMacroDescription() const
void x_GetParsedTextFncCore(string &parsed_fnc) const
pair< string, bool > m_IncludeRight
pair< string, bool > m_CaseSensitive
virtual vector< string > GetFunctionNames() const
CParseRNAQualTreeItemData()
virtual string GetMacroDescription() const
virtual vector< string > GetMainFunctions() const
virtual void x_AddParamPanel(wxWindow *parent)
virtual bool UpdateTarget()
virtual string GetFunction(TConstraints &constraints) const
virtual string GetVariables()
virtual const vector< string > & GetKeywords() const
CParseToBsrcTreeItemData()
virtual void x_AddParamPanel(wxWindow *parent)
virtual vector< string > GetMainFunctions() const
virtual string GetFunction(TConstraints &constraints) const
virtual vector< string > GetFunctionNames() const
virtual const vector< string > & GetKeywords() const
CParseToCdsGeneProtTreeItemData()
virtual bool UpdateTarget()
virtual string GetFunction(TConstraints &constraints) const
virtual void x_AddParamPanel(wxWindow *parent)
virtual vector< string > GetFunctionNames() const
virtual string GetVariables()
virtual string GetVariables()
virtual void x_AddParamPanel(wxWindow *parent)
virtual vector< string > GetMainFunctions() const
virtual string GetFunction(TConstraints &constraints) const
CParseToDBLinkTreeItemData()
virtual vector< string > GetFunctionNames() const
CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...
void x_LoadPanel(wxWindow *parent, const string &panel_name, const TArgumentsVector &arguments)
unique_ptr< CMacroPanelLoader > m_Panel
constructed panel for specifying function arguments
vector< pair< string, string > > TConstraints
bool Empty(const CNcbiOstrstream &src)
static CTempString GetFuncName()
static const char * sm_SeqForFeat
static CTempString GetFuncName()
static CTempString GetFuncName()
static const char * sm_SeqForDescr
class CMacroFunction_Sequence_For_Seqdesc SEQUENCE_FOR_SEQDESC(field_name) SEQUENCE_FOR_SEQFEAT(field...
static CTempString GetFuncName()
static CTempString GetFuncName()
static CTempString GetFuncName()
static CTempString GetFuncName()
static CTempString GetFuncName()
static CTempString GetFuncName()
#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 bool EndsWith(const CTempString str, const CTempString end, ECase use_case=eCase)
Check if a string ends with a specified suffix value.
static const string BoolToString(bool value)
Convert bool to 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 EqualNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive equality of a substring with another string.
vector< macro::SArgMetaData > TArgumentsVector
pair< string, string > GetResolveFuncForDestCdsGeneProtQuals(const string &fieldname, const string &rt_var, TConstraints &constraints, bool remove_constraint)
void UpdateConstraintsForDualCdsGeneProt(TConstraints &constraints, const string &src_feat)
void OnRemoveFromParsedField(CArgumentList &list, CArgument &arg)
void OnRightDigitsLettersInParsePanels(CArgumentList &list, CArgument &arg)
void OnLeftDigitsLettersInParsePanels(CArgumentList &list, CArgument &arg)
void OnStructCommFieldDblChanged(CArgumentList &list, CArgument &arg)
bool MultipleValuesAllowed(const string &field)
void UpdateConstraintsForFeatures(TConstraints &constraints, const string &feature)
EMacroFieldType GetSourceTypeInDoublePanel(const CArgumentList &arg_list, EDirType dir)
string GetResolveFuncForMultiValuedQual(const string &field, const string &rt_var, TConstraints &constraints, bool remove_constraint)
pair< string, string > GetResolveFuncForRNAQuals(const string &fieldname, const string &rt_var, TConstraints &constraints, bool remove_constraint)
string GetResolveFuncForQual(const string &container, const string &field, const string &rt_var, TConstraints &constraints, bool remove_constraint=true)
Generates the definition of rt_var based on input "field".
string GetUpdatemRNADescription(const CArgument &arg)
void AddConstraintIgnoreNewText(const string &field, TConstraints &constraints, const CArgumentList &arg_list, const string &target=kEmptyStr)
CTempString UpdateTargetForDualFeatures(const string &feature, const string &from_field)
pair< string, string > GetResolveFuncForSrcCdsGeneProtQuals(const string &fieldname, const string &rt_var, TConstraints &constraints, bool remove_constraint)
CTempString UpdateTargetForRnas(const string &rna_type)
void WrapInQuotes(string &str)
string GetEditableFieldForPair(const string &field, const string &rt_var, bool is_feature)
void OnProteinNameDouble(CArgumentList &list, CArgument &arg)
string GetCapitalizationTypeFromChoice(const string &cap_change)
pair< string, string > GetResolveFuncForDestFeatQuals(const string &feature, const string &field, const string &rt_var, TConstraints &constraints, bool remove_constraint)
pair< string, string > GetResolveFuncForSrcFeatQuals(const string &feature, const string &field, const string &rt_var, TConstraints &constraints, bool remove_constraint)
void OnExistingTextChanged(CArgumentList &list, CArgument &arg)
string GetHandleOldValue(const string &type)
void OnRnaTypeChanged(CArgumentList &list, CArgument &arg)
void UpdateConstraintsForRnas(TConstraints &constraints, const CArgumentList &arg_list)
string GetDelimiterChar(const string &del)
void UpdateFeatureType(string &feature, const string &field)
CTempString UpdateTargetForCdsGeneProt(const string &fieldname)
void OnProductDouble(CArgumentList &list, CArgument &arg)
void AppendUpdatemRNAFnc(bool update_mrna, string &function)
void GetFeatureAndField(const string &field_name, string &feature, string &field)
string GetExistingTextDescr(const CArgumentList &arg_list)
string GetUpdatemRNAVar(const CArgumentList &arg_list)
const string kWholeWordParse
const string kDigitsRight
const string kLetterRight
const TArgumentsVector & GetOptionalArgs()
const TArgumentsVector & GetParseArgs()
const string kExistingText
const TArgumentsVector & GetDualBsrcArgs()
const string kCaseInsensParse
const string kStrCommField
const CharType(& source)[N]
void copy(Njn::Matrix< S > *matrix_, const Njn::Matrix< T > &matrix0_)