70 switch (name.
Which()) {
84 if( sSpecies.find(
" ") != string::npos &&
95 if( sSubspecies.find(
" ") != string::npos && !bSubspIndicator ) {
97 name_out += sSubspecies;
101 if( !bSubspIndicator ) {
102 string sNomenclature;
103 bool bZooCode =
false;
105 bZooCode = sNomenclature ==
"Z";
108 bZooCode = sLineage.find(
"Metazoa;") != string::npos ||
109 sLineage.find(
"Slopalinida;") != string::npos ||
110 sLineage.find(
"Blastocystis;") != string::npos;
113 name_out +=
" subsp.";
115 if( sSubspecies.find_first_not_of(
"abcdefghijklmnopqrstuvwxyz-") != string::npos ||
116 sSubspecies[0] ==
'-' ) {
121 name_out +=
' ' + sSubspecies;
130 name_out +=
" var. ";
131 name_out += (*it)->GetSubname();
138 name_out += (*it)->GetSubname();
141 name_out +=
" f.sp. ";
142 name_out += (*it)->GetSubname();
163 if ((*it)->GetFlatName(
tmp, &sLineage)) {
165 if( (*it)->IsSetName() && (*it)->GetName().IsHybrid() ) {
184 name_out += delim + (*it)->GetName();
215 list< CTempString > lVals;
217 for( list< CTempString >::iterator
i = lVals.begin(), li = lVals.end();
i != li; ) {
221 i = lVals.erase(
i );
237 list< CTempString > lVals;
256 list< CTempString > lVals;
261 i->size() > name.size() && (*
i)[name.size()] ==
'=' ) {
262 sValue.assign(
i->substr(name.size()+1) );
320 #define MAKE_COMMON(o1,o2,o3,Field) if (o1.IsSet##Field() && o2.IsSet##Field() && NStr::Equal(o1.Get##Field(), o2.Get##Field())) o3.Set##Field(o1.Get##Field());
321 #define MAKE_COMMON_INT(o1,o2,o3,Field) if (o1.IsSet##Field() && o2.IsSet##Field() && o1.Get##Field() == o2.Get##Field()) o3.Set##Field(o1.Get##Field());
339 if ((*it1)->Equals(**it2)) {
346 common->
SetMod().push_back(add);
376 result = (*ci)->GetSubname();
389 memset( norm_nom, 0,
sizeof(norm_nom) );
390 ITERATE(
string, ci, nomenclature ) {
392 case 'b':
case 'B': norm_nom[0] =
'B';
break;
393 case 'p':
case 'P': norm_nom[1] =
'P';
break;
394 case 'v':
case 'V': norm_nom[2] =
'V';
break;
395 case 'z':
case 'Z': norm_nom[3] =
'Z';
break;
396 default:
return false;
400 for(
size_t i = 0;
i <
sizeof(norm_nom); ++
i ) {
401 if( norm_nom[
i] != 0 ) {
402 sNewVal += norm_nom[
i];
408 if( sOldVal == sNewVal ) {
414 if( !sNewVal.empty() ) {
416 SetMod().push_back( pMod );
432 for( TMod::iterator
i =
SetMod().begin();
i !=
SetMod().end(); ) {
433 if( (*i)->GetSubtype() == to_remove ) {
#define MAKE_COMMON(o1, o2, o3, Field)
#define MAKE_COMMON_INT(o1, o2, o3, Field)
const CTempString s_flagDelim
User-defined methods of the data storage class.
User-defined methods of the data storage class.
@OrgMod.hpp User-defined methods of the data storage class.
bool x_GetAttribValue(const string &name, string &sValue) const
bool IsFormalName() const
bool x_GetAttribFlag(const string &name, bool bStartsWith=false) const
bool GetFlatName(string &name_out, string *lineage=0) const
unsigned int RemoveModBySubtype(COrgMod::ESubtype to_remove)
void DisableModifierForwarding()
void SetFormalNameFlag(bool bFormalName)
bool IsUncultured() const
void x_SetAttribFlag(const string &name, bool bStartsWith=false)
CRef< COrgName > MakeCommon(const COrgName &other) const
void SetUncultured(bool bUncultured)
void EnableModifierForwarding()
bool GetNomenclature(string &result) const
bool SetNomenclature(const string &nomenclature)
bool IsModifierForwardingDisabled() const
void x_ResetAttribFlag(const string &name, bool bStartsWith=false)
CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...
#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.
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
virtual bool Equals(const CSerialObject &object, ESerialRecursionMode how=eRecursive) const
Check if both objects contain the same values.
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 void TruncateSpacesInPlace(string &str, ETrunc where=eTrunc_Both)
Truncate spaces in a string (in-place)
static string Join(const TContainer &arr, const CTempString &delim)
Join strings using the specified delimiter.
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.
static string TruncateSpaces(const string &str, ETrunc where=eTrunc_Both)
Truncate spaces in a string.
@ fSplit_Tokenize
All delimiters are merged and trimmed, to get non-empty tokens only.
@ eNocase
Case insensitive compare.
const TMod & GetMod(void) const
Get the Mod member data.
void ResetAttrib(void)
Reset Attrib data member.
const TLineage & GetLineage(void) const
Get the Lineage member data.
bool IsSetPgcode(void) const
plastid genetic code Check if a value has been assigned to Pgcode data member.
const TVirus & GetVirus(void) const
Get the variant data.
E_Choice Which(void) const
Which variant is currently selected.
const THybrid & GetHybrid(void) const
Get the variant data.
void SetName(TName &value)
Assign a value to Name data member.
bool IsSetLineage(void) const
lineage with semicolon separators Check if a value has been assigned to Lineage data member.
bool IsSetSubspecies(void) const
Check if a value has been assigned to Subspecies data member.
const TName & GetName(void) const
Get the Name member data.
bool IsSetMgcode(void) const
mitochondrial genetic code Check if a value has been assigned to Mgcode data member.
const TBinomial & GetBinomial(void) const
Get the variant data.
bool IsSetDiv(void) const
GenBank division code Check if a value has been assigned to Div data member.
bool IsSetMod(void) const
Check if a value has been assigned to Mod data member.
const Tdata & Get(void) const
Get the member data.
list< CRef< COrgMod > > TMod
bool IsSetAttrib(void) const
attribution of name Check if a value has been assigned to Attrib data member.
list< CRef< COrgName > > Tdata
const TSpecies & GetSpecies(void) const
Get the Species member data.
list< CRef< CTaxElement > > Tdata
bool IsSetGcode(void) const
genetic code (see CdRegion) Check if a value has been assigned to Gcode data member.
TMod & SetMod(void)
Assign a value to Mod data member.
const TGenus & GetGenus(void) const
Get the Genus member data.
const TPartial & GetPartial(void) const
Get the variant data.
TAttrib & SetAttrib(void)
Assign a value to Attrib data member.
const TNamedhybrid & GetNamedhybrid(void) const
Get the variant data.
bool IsSetSpecies(void) const
species required if subspecies used Check if a value has been assigned to Species data member.
bool IsSetName(void) const
Check if a value has been assigned to Name data member.
const Tdata & Get(void) const
Get the member data.
const TSubspecies & GetSubspecies(void) const
Get the Subspecies member data.
const TAttrib & GetAttrib(void) const
Get the Attrib member data.
@ eSubtype_nomenclature
code of nomenclature in subname (B,P,V,Z or combination)
@ eSubtype_forma_specialis
@ e_Hybrid
hybrid between organisms
@ e_Namedhybrid
some hybrids have genus x species name
@ e_Binomial
genus/species type name
@ e_Partial
when genus not known
@ e_Virus
virus names are different
constexpr bool empty(list< Ts... >) noexcept