#include <clientapi.h> #include "DAUserAnnotate.h" #include "DAFile.h" #include <strtable.h> DAUserAnnotate::DAUserAnnotate( DAFile* f, ClientUser* u, bool q ) :file( f ), ui( u ), quiet( q ) { done = seenFile = false; } DAUserAnnotate::~DAUserAnnotate(void) { } void DAUserAnnotate::OutputStat( StrDict* varList ) { if ( done ) return; StrPtr* data = varList->GetVar( "data" ); StrPtr* upper = varList->GetVar( "upper" ); StrPtr* lower = varList->GetVar( "lower" ); if ( !data || !upper || !lower ) { if ( seenFile ) { done = true; return; } seenFile = true; if ( ui && !quiet ) ui->OutputStat( varList ); return; } file->addLine( data, upper->Atoi(), lower->Atoi() ); } void DAUserAnnotate::Message( Error* err ) { if ( seenFile ) { done = true; return; } seenFile = true; if ( ui && ( !quiet || !err->IsInfo() ) ) ui->Message( err ); return; } void DAUserAnnotate::OutputText( const char* data, int ) { if ( done ) return; StrBuf lower, upper; while ( *data && *data != '-' ) // lower { lower.Append( data++, 1 ); } if ( *data ) data++; // '-' while ( *data && *data != ':' ) // upper { upper.Append( data++, 1 ); } if ( *data ) data++; // ':' if ( *data ) data++; // ' ' StrRef text( data ); if ( !lower.Length() || !upper.Length() ) return; file->addLine( &text, upper.Atoi(), lower.Atoi() ); }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 6297 | Sam Stafford |
Work so far on "deep annotate". Been getting a lot of questions on this lately from other people working on the same thing; might as well pool efforts. |