NCBI C++ ToolKit
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
CTabDelimitedValidator Class Reference

Search Toolkit Book for CTabDelimitedValidator

#include "tab_table_reader.hpp"
(Private to src/app/tableval.)

+ Collaboration diagram for CTabDelimitedValidator:

Public Types

enum  e_Flags {
  e_tab_tab_delim = 1 , e_tab_comma_delim = 2 , e_tab_noheader = 4 , e_tab_ignore_empty_rows = 8 ,
  e_tab_xml_report = 16 , e_tab_tab_report = 32 , e_tab_text_report = 16+32 , e_tab_html_report = 64 ,
  e_tab_ignore_unknown_types = 128
}
 

Public Member Functions

 CTabDelimitedValidator (e_Flags flags=e_tab_tab_delim)
 
void ValidateInput (ILineReader &reader, const string &default_columns, const string &required, const string &ignored, const string &unique, const string &discouraged, const vector< string > &require_one)
 
void GenerateOutput (CNcbiOstream *out_stream, bool no_headers)
 

Static Public Member Functions

static void RegisterAliases (CNcbiIstream *in_stream)
 

Private Member Functions

bool _Validate (int col_number, const CTempString &value)
 
void _OperateRows (ILineReader &reader)
 
bool _ProcessHeader (ILineReader &reader, const CTempString &default_cols)
 
bool _CheckHeader (const string &discouraged, const vector< string > &require_one)
 
bool _MakeColumns (const string &message, const CTempString &columns, vector< bool > &col_defs)
 
void _ReportError (int col_number, const CTempString &error, const CTempString &colname, bool warning=false)
 
void _ReportWarning (int col_number, const CTempString &error, const CTempString &colname)
 
void _ReportTab (CNcbiOstream *out_stream)
 
void _ReportXML (CNcbiOstream *out_stream, bool no_headers)
 

Private Attributes

int m_current_row_number
 
CTempString m_delim
 
vector< stringm_col_defs
 
vector< boolm_required_cols
 
vector< boolm_ignored_cols
 
vector< boolm_unique_cols
 
vector< set< string > > m_require_one_cols
 
vector< map< string, int > > m_unique_values
 
list< CTabDelimitedValidatorMessagem_errors
 
e_Flags m_flags
 

Detailed Description

Definition at line 31 of file tab_table_reader.hpp.

Member Enumeration Documentation

◆ e_Flags

Enumerator
e_tab_tab_delim 
e_tab_comma_delim 
e_tab_noheader 
e_tab_ignore_empty_rows 
e_tab_xml_report 
e_tab_tab_report 
e_tab_text_report 
e_tab_html_report 
e_tab_ignore_unknown_types 

Definition at line 34 of file tab_table_reader.hpp.

Constructor & Destructor Documentation

◆ CTabDelimitedValidator()

CTabDelimitedValidator::CTabDelimitedValidator ( e_Flags  flags = e_tab_tab_delim)
inline

Definition at line 49 of file tab_table_reader.hpp.

Member Function Documentation

◆ _CheckHeader()

bool CTabDelimitedValidator::_CheckHeader ( const string discouraged,
const vector< string > &  require_one 
)
private

◆ _MakeColumns()

bool CTabDelimitedValidator::_MakeColumns ( const string message,
const CTempString columns,
vector< bool > &  col_defs 
)
private

◆ _OperateRows()

void CTabDelimitedValidator::_OperateRows ( ILineReader reader)
private

◆ _ProcessHeader()

bool CTabDelimitedValidator::_ProcessHeader ( ILineReader reader,
const CTempString default_cols 
)
private

◆ _ReportError()

void CTabDelimitedValidator::_ReportError ( int  col_number,
const CTempString error,
const CTempString colname,
bool  warning = false 
)
private

◆ _ReportTab()

void CTabDelimitedValidator::_ReportTab ( CNcbiOstream out_stream)
private

Definition at line 179 of file tab_table_reader.cpp.

References ITERATE, and m_errors.

Referenced by GenerateOutput().

◆ _ReportWarning()

void CTabDelimitedValidator::_ReportWarning ( int  col_number,
const CTempString error,
const CTempString colname 
)
private

Definition at line 64 of file tab_table_reader.cpp.

References _ReportError().

◆ _ReportXML()

void CTabDelimitedValidator::_ReportXML ( CNcbiOstream out_stream,
bool  no_headers 
)
private

◆ _Validate()

bool CTabDelimitedValidator::_Validate ( int  col_number,
const CTempString value 
)
private

◆ GenerateOutput()

void CTabDelimitedValidator::GenerateOutput ( CNcbiOstream out_stream,
bool  no_headers 
)

◆ RegisterAliases()

void CTabDelimitedValidator::RegisterAliases ( CNcbiIstream in_stream)
static

◆ ValidateInput()

void CTabDelimitedValidator::ValidateInput ( ILineReader reader,
const string default_columns,
const string required,
const string ignored,
const string unique,
const string discouraged,
const vector< string > &  require_one 
)

Member Data Documentation

◆ m_col_defs

vector<string> CTabDelimitedValidator::m_col_defs
private

◆ m_current_row_number

int CTabDelimitedValidator::m_current_row_number
private

Definition at line 80 of file tab_table_reader.hpp.

Referenced by _OperateRows(), _ProcessHeader(), _ReportError(), and ValidateInput().

◆ m_delim

CTempString CTabDelimitedValidator::m_delim
private

Definition at line 81 of file tab_table_reader.hpp.

Referenced by _OperateRows(), _ProcessHeader(), and ValidateInput().

◆ m_errors

list<CTabDelimitedValidatorMessage> CTabDelimitedValidator::m_errors
private

Definition at line 90 of file tab_table_reader.hpp.

Referenced by _ReportError(), _ReportTab(), and _ReportXML().

◆ m_flags

e_Flags CTabDelimitedValidator::m_flags
private

Definition at line 91 of file tab_table_reader.hpp.

Referenced by _OperateRows(), GenerateOutput(), and ValidateInput().

◆ m_ignored_cols

vector<bool> CTabDelimitedValidator::m_ignored_cols
private

Definition at line 84 of file tab_table_reader.hpp.

Referenced by _CheckHeader(), _OperateRows(), and ValidateInput().

◆ m_require_one_cols

vector< set<string> > CTabDelimitedValidator::m_require_one_cols
private

Definition at line 86 of file tab_table_reader.hpp.

Referenced by _CheckHeader(), and _OperateRows().

◆ m_required_cols

vector<bool> CTabDelimitedValidator::m_required_cols
private

Definition at line 83 of file tab_table_reader.hpp.

Referenced by _OperateRows(), and ValidateInput().

◆ m_unique_cols

vector<bool> CTabDelimitedValidator::m_unique_cols
private

Definition at line 85 of file tab_table_reader.hpp.

Referenced by _OperateRows(), and ValidateInput().

◆ m_unique_values

vector< map<string, int> > CTabDelimitedValidator::m_unique_values
private

Definition at line 88 of file tab_table_reader.hpp.

Referenced by _OperateRows(), and ValidateInput().


The documentation for this class was generated from the following files:
Modified on Fri Sep 20 14:58:14 2024 by modify_doxy.py rev. 669887