From 4ea12e162a40e43faae99225386aedb8a0b9f1c4 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Wed, 20 Sep 2006 20:15:48 +0000 Subject: Viewer is nice now. --- src/viewerplain.cpp | 30 +++++++++++++++++++++++++++--- src/viewerplain.h | 7 +++++++ 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/src/viewerplain.cpp b/src/viewerplain.cpp index 5690215..d65c59d 100644 --- a/src/viewerplain.cpp +++ b/src/viewerplain.cpp @@ -4,7 +4,9 @@ PluginInterface2( plain, ViewerPlain, Viewer, "Mike Buland", 0, 1 ); -ViewerPlain::ViewerPlain() +ViewerPlain::ViewerPlain() : + bCmdClean( true ), + bRunClean( true ) { } @@ -14,16 +16,29 @@ ViewerPlain::~ViewerPlain() void ViewerPlain::beginCommand( Action::eAction nAct, const std::string &sTarget ) { - printf("--- %s ---\n", sTarget.c_str() ); + bCmdClean = true; + this->sTarget = sTarget; } void ViewerPlain::endCommand() { - printf("\n"); + if( bCmdClean == false ) + printf("\n"); +} + +void ViewerPlain::printHead() +{ + if( bCmdClean == true ) + { + bRunClean = false; + bCmdClean = false; + printf("--- %s ---\n", sTarget.c_str() ); + } } void ViewerPlain::beginRequiresCheck( bool bCached, const std::string &sName ) { + printHead(); printf(" deps: %s\n", sName.c_str() ); } @@ -33,6 +48,7 @@ void ViewerPlain::endRequiresCheck() void ViewerPlain::beginPerform( Perform *pPerform ) { + printHead(); printf(" %8s: %s\n", pPerform->getRule().c_str(), pPerform->getTarget().c_str() ); } @@ -40,3 +56,11 @@ void ViewerPlain::endPerform() { } +void ViewerPlain::endAction() +{ + if( bRunClean == true ) + { + printf("Nothing to be done.\n\n"); + } +} + diff --git a/src/viewerplain.h b/src/viewerplain.h index 978d50b..76fecc5 100644 --- a/src/viewerplain.h +++ b/src/viewerplain.h @@ -19,7 +19,14 @@ public: virtual void beginPerform( Perform *pPerform ); virtual void endPerform(); + virtual void endAction(); + + void printHead(); + private: + bool bCmdClean; + bool bRunClean; + std::string sTarget; }; -- cgit v1.2.3