(raw_line.
empty())
121 switch(translation_result) {
125 info.second.first,
info.second.second);
129translated,
info.second.first,
info.second.second);
145GetMyStream().x_ClearTraitsProvidedFieldsInfo();
163 string& translated_value)
165 if(raw_value ==
"-") {
166translated_value =
"";
169 if(raw_value ==
"na")
179vector<CTempString> tokens;
184 for(
const auto& name : tokens) {
185GetMyStream().x_SetFieldName(field_no,
186 string(name.data(), name.length()));
198 for(
const auto&
info: GetMyStream().GetFieldsMetaInfo()) {
199 if(
info.is_type_initialized) {
200 autofield_type =
info.type.GetType();
204make_pair(field_type,
info.type.GetProps());
static void ValidateBasicTypeFieldValue(const CTempString &str_value, ERR_FieldType field_type, const string &props)
ERR_Action Tokenize(const CTempString raw_line, vector< CTempString > &tokens)
Tokenize the raw line and put the tokens into the tokens vector.
The following rules are going to be applied for the NCBI TSV sources:
ERR_Action Validate(CTempString raw_line, ERR_FieldValidationMode field_validation_mode)
ERR_Action OnNextLine(CTempString raw_line)
map< size_t, pair< ERR_FieldType, string > > m_FieldsToValidate
vector< CTempString > m_ValidationTokens
CRowReaderStream_NCBI_TSV()
ERR_EventAction OnEvent(ERR_Event event, ERR_EventMode event_mode)
RR_TRAITS_PARENT_STREAM(CRowReaderStream_NCBI_TSV)
void x_GetFieldTypesToValidate(void)
void x_ExtractNames(const CTempString &raw_line)
ERR_TranslationResult Translate(TFieldNo, const CTempString raw_value, string &translated_value)
Partial specialization of the CRowReaderStream_CharDelimited<...> template for the case when the data...
CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
const char * data(void) const
Return a pointer to the array represented.
bool empty(void) const
Return true if the represented string is empty (i.e., the length is zero)
static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)
Check if a string starts with a specified prefix value.
size_type size(void) const
Return the length of the represented array.
Uint4 TFieldNo
Field number (zero based)
ERR_FieldValidationMode
Whether to check validity of the fields (names and/or values)
@ eRR_NoFieldValidation
don't validate fields' value and name
ERR_TranslationResult
The Translate() callback result. It is used to translate field values.
@ eRR_UseOriginal
No translation done.
@ eRR_Translated
The value has been translated to another string.
@ eRR_Null
The value has been translated to NULL.
ERR_Action
Delimited stream traits use the ERR_Action members to instruct what should be done next.
@ eRR_Continue_Data
Continue processing this line, in full.
@ eRR_Skip
Skip this line.
@ eRR_Continue_Metadata
Continue processing this line but skip Tokenize() and Translate()
@ eRR_Continue_Comment
Continue processing this line but skip Tokenize() and Translate()
ERR_EventAction
How to react to the potentially disruptive events.
@ eRR_EventAction_Continue
Resume processing.
@ eRR_EventAction_Default
Do some default action.
ERR_EventMode
Indicate whether the "ERR_Event" event (passed to the OnEvent() callback) occured during regular read...
@ eRR_EventMode_Validating
We are performing data validation.
ERR_Event
CRowReader passes such events to the Traits via OnEvent() callback.
@ eRR_Event_SourceEnd
Data source has hit EOF.
@ eRR_Event_SourceBegin
Data source has started or been switched (no reads yet though).
@ eRR_Event_SourceError
Data source has hit an error on read.
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