Beispiel #1
0
void AddVars( ALib::Expression & e, const IOManager & io, const CSVRow & row ) {
	e.ClearPosParams();
	e.AddVar( LINE_VAR, ALib::Str( io.CurrentLine() ));
	e.AddVar( FILE_VAR, ALib::Str( io.CurrentFileName()));
	e.AddVar( FIELD_VAR, ALib::Str( row.size()));
	for ( unsigned int j = 0; j < row.size(); j++ ) {
		e.AddPosParam( row.at( j ) );
	}
}
Beispiel #2
0
void ValidateCommand :: Report( IOManager & io,
								const ValidationRule::Results & res,
								int errcount ) const {
	if ( res.size() == 0 ) {
		return;
	}
	else {
		if ( errcount == 0 ) {
			io.Out() << io.CurrentFileName() << " (" << io.CurrentLine () << "): ";
			io.Out() << io.CurrentInput() << "\n";
		}
		for ( unsigned int i = 0; i < res.size(); i++ ) {
			if ( res[i].Field() > 0 ) {
				io.Out() << "    field: " << res[i].Field() << " - ";
			}
			else {
				io.Out() << "    ";
			}
			io.Out() << res[i].Msg() << "\n";
		}
	}
}