unique_ptr<objects::CTaxon1> m_taxClient;
94 names.insert(it->first);
97 static const char* message =
"Supported data types are: ";
98 size_t n= strlen(message);
99out_stream << message;
102 if(it !=
names.begin()) {
106 if(
n+ it->length() > 77) {
122 error=
"Datatype \"";
124 error+=
"\" is unknown";
129 returnit->second->DoValidate(
value,
error);
138 booloperator()(
constpair<string, CColumnValidator*>&
l)
const 140 return(
l.second == _this);
154 if(m_taxClient.get() == 0)
156m_taxClient.reset(
new CTaxon1);
162 TTaxIdtaxid = NStr::StringToNumeric<TTaxId>(
value);
163m_taxClient->GetById(taxid);
176 if(m_taxClient.get() == 0)
178m_taxClient.reset(
new CTaxon1);
184m_taxClient->GetTaxIdByName(
value);
204 error=
"unknown origin type";
243 error=
"Unknown accession type";
266 if(!
value.empty())
282 static const char* supported_formats[]= {
283 "d-b-Y",
"d-B-Y",
"b-Y",
"B-Y",
"Y",
287 boolbad_format(
true), in_future(
false);
297 for(
const char** fmt = supported_formats; *fmt && bad_format; fmt++)
313 error=
"Unsupported date format";
316 error=
"Date in future";
325 if(!
value.empty())
328 boolis_miscapitalized(
false);
330 error=
"Country is not valid";
331 if(is_miscapitalized)
332 error=
"Country is miscapitalized";
344 if(
value!=
"TRUE"&&
346 error=
"Can have TRUE only";
static CBioSource::EOrigin GetOriginByString(const string &origin, NStr::ECase use_case=NStr::eCase, bool starts_with=false)
static CBioSource::EGenome GetGenomeByOrganelle(const string &organelle, NStr::ECase use_case=NStr::eCase, bool starts_with=false)
~CColumnValidatorRegistry()
bool DoValidate(const string &datatype, const CTempString &value, string &error) const
bool IsSupported(const string &datatype) const
void UnRegister(CColumnValidator *val)
void PrintSupported(CNcbiOstream &out_stream) const
void Register(const CTempString &name, CColumnValidator *val)
CColumnValidatorRegistry()
static CColumnValidatorRegistry & GetInstance()
static bool IsDiscouraged(const string &column)
virtual ~CColumnValidator()
static bool IsValid(const string &country)
ECompare Compare(const CDate &date) const
@ eCompare_after
*this comes second.
static bool IsDiscouraged(const TSubtype stype, bool indexer=false)
static TSubtype GetSubtypeValue(const string &str, EVocabulary vocabulary=eVocabulary_raw)
Root class for all serialization exceptions.
static bool IsISOFormatDate(const string &orig_date)
static TSubtype GetSubtypeValue(const string &str, EVocabulary vocabulary=eVocabulary_raw)
static CRef< CDate > GetDateFromISODate(const string &orig_date)
static bool IsDiscouraged(const TSubtype subtype)
CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...
container_type::const_iterator const_iterator
const_iterator begin() const
const_iterator end() const
const_iterator find(const key_type &key) const
#define DEFINE_COL_VALIDATOR4(name, text1, text2, text3)
#define DEFINE_COL_VALIDATOR(name)
#define DEFINE_COL_VALIDATOR3(name, text1, text2)
static const struct name_t names[]
static const char * column
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
SStrictId_Tax::TId TTaxId
Taxon id type.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
const string & GetMsg(void) const
Get message string.
static EAccessionInfo IdentifyAccession(const CTempString &accession, TParseFlags flags=fParse_AnyRaw)
Deduces information from a bare accession a la WHICH_db_accession; may report false negatives on prop...
EAccessionInfo
For IdentifyAccession (below)
@ fParse_AnyLocal
Treat otherwise unidentified strings as local accessions as long as they don't resemble FASTA-style I...
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
@ eCurrent
Use current time. See also CCurrentTime.
const GenericPointer< typename T::ValueType > T2 value
Defines NCBI C++ exception handling.
static const GLdouble origin[]
static SLJIT_INLINE sljit_ins st(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
static SLJIT_INLINE sljit_ins l(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
CRef< objects::CObjectManager > om
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