59 if (seqdesc && seqdesc->
IsUser()) {
65 CUser_object::TData::iterator it = user->
SetData().begin();
66 while (it != user->
SetData().end()) {
67 if ((*it)->IsSetLabel() && (*it)->GetLabel().IsStr()) {
70 rval |=
SetVal(**it, newValue, existing_text);
74 if (!(*it)->IsSetData()) {
85 user->
SetData().push_back(new_field);
109 field.
SetData().SetStrs().push_back(curr_val);
110 field.
SetData().SetStrs().push_back(newValue);
113 field.
SetData().SetStrs().push_back(curr_val);
120 field.
SetData().SetStrs().push_back(newValue);
132 field.
SetData().SetStrs().push_back(newValue);
137 field.
SetData().SetStrs().push_back(newValue);
147 vector<string> vals =
GetVals(
object);
148 if (vals.size() > 0) {
163 if (seqdesc && seqdesc->
IsUser()) {
167 CUser_object::TData::const_iterator it = user->
GetData().begin();
168 while (it != user->
GetData().end()) {
169 if ((*it)->IsSetLabel() && (*it)->GetLabel().IsStr() && (*it)->IsSetData()) {
172 switch((*it)->GetData().Which()) {
174 vals.push_back((*it)->GetData().GetStr());
214 vector<CConstRef<CObject> >
objects;
220 object.
Reset(&(*desc_ci));
232 vector<CRef<CApplyObject> >
objects;
255 vector<CConstRef<CObject> > objs;
258 CBioseq_CI bi (seh, objects::CSeq_inst::eMol_na);
261 if (edit::CSeqIdGuesser::DoesSeqMatchConstraint(*bi, string_constraint)) {
262 vector<CConstRef<CObject> > these_objs =
GetObjects(*bi);
263 objs.insert(objs.end(), these_objs.begin(), these_objs.end());
266 vector<CConstRef<CObject> > these_objs =
GetObjects(*bi);
269 objs.push_back (*it);
285 if (seqdesc && seqdesc->
IsUser()) {
303 if (seqdesc && seqdesc->
IsUser()) {
307 CUser_object::TData::iterator it = user->
SetData().begin();
308 while (it != user->
SetData().end()) {
309 bool do_erase =
false;
310 if ((*it)->IsSetLabel() && (*it)->GetLabel().IsStr()) {
317 it = user->
SetData().erase(it);
331 vector<CConstRef<CObject> > related;
340 }
else if (obj_desc) {
343 related.push_back(obj);
356 vector<CConstRef<CObject> > related;
358 const CSeqdesc * obj_desc =
dynamic_cast<const CSeqdesc *
>(&(
object.GetObject()));
363 }
else if (obj_desc) {
366 related.push_back(obj);
CSeq_entry_Handle GetSeqEntryForSeqdesc(CRef< CScope > scope, const CSeqdesc &seq_desc)
static EDBLinkFieldType GetTypeForLabel(string label)
@ eDBLinkFieldType_Unknown
static string GetLabelForType(EDBLinkFieldType field_type)
virtual bool IsEmpty(const CObject &object) const
CDBLinkFieldType::EDBLinkFieldType m_FieldType
CRef< objects::edit::CStringConstraint > m_StringConstraint
static bool IsDBLink(const CUser_object &user)
virtual string GetLabel() const
virtual void SetConstraint(const string &field_name, CConstRef< edit::CStringConstraint > string_constraint)
virtual vector< CRef< objects::edit::CApplyObject > > GetApplyObjects(CBioseq_Handle bsh)
virtual string GetVal(const CObject &object)
CDBLinkFieldType::EDBLinkFieldType m_ConstraintFieldType
virtual vector< string > GetVals(const CObject &object)
virtual vector< CConstRef< CObject > > GetObjects(CBioseq_Handle bsh)
virtual void ClearVal(CObject &object)
virtual vector< CConstRef< CObject > > GetRelatedObjects(const CObject &object, CRef< CScope > scope)
virtual bool SetVal(CObject &object, const string &newValue, objects::edit::EExistingText existing_text)
namespace ncbi::objects::
const char * kFieldTypeSeqId
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
CScope & GetScope(void) const
Get scope this handle belongs to.
void Reset(void)
Reset reference object.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static bool EqualNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive equality of a substring with another string.
const TStr & GetStr(void) const
Get the variant data.
bool IsSetData(void) const
the object itself Check if a value has been assigned to Data data member.
bool IsStr(void) const
Check if variant Str is selected.
bool IsSetType(void) const
type of object within class Check if a value has been assigned to Type data member.
bool IsStrs(void) const
Check if variant Strs is selected.
const TStrs & GetStrs(void) const
Get the variant data.
const TData & GetData(void) const
Get the Data member data.
bool IsStr(void) const
Check if variant Str is selected.
TData & SetData(void)
Assign a value to Data data member.
const TStr & GetStr(void) const
Get the variant data.
void SetLabel(TLabel &value)
Assign a value to Label data member.
const TData & GetData(void) const
Get the Data member data.
void ResetData(void)
Reset Data data member.
void SetData(TData &value)
Assign a value to Data data member.
const TType & GetType(void) const
Get the Type member data.
bool IsSetData(void) const
Check if a value has been assigned to Data data member.
vector< CStringUTF8 > TStrs
E_Choice Which(void) const
Which variant is currently selected.
@ e_not_set
No variant selected.
const TLocation & GetLocation(void) const
Get the Location member data.
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.
@ e_User
user defined object
bool DoesObjectMatchFieldConstraint(const CObject &object, const string &field_name, CRef< objects::edit::CStringConstraint > string_constraint, CRef< objects::CScope > scope)
@ eExistingText_replace_old
bool AddValueToString(string &str, const string &value, EExistingText existing_text)
Add text to an existing string, using the "existing_text" directive to combine new text with existing...