diff options
Diffstat (limited to 'src/viewerplain.cpp')
-rw-r--r-- | src/viewerplain.cpp | 35 |
1 files changed, 28 insertions, 7 deletions
diff --git a/src/viewerplain.cpp b/src/viewerplain.cpp index d65c59d..9037a40 100644 --- a/src/viewerplain.cpp +++ b/src/viewerplain.cpp | |||
@@ -5,7 +5,6 @@ | |||
5 | PluginInterface2( plain, ViewerPlain, Viewer, "Mike Buland", 0, 1 ); | 5 | PluginInterface2( plain, ViewerPlain, Viewer, "Mike Buland", 0, 1 ); |
6 | 6 | ||
7 | ViewerPlain::ViewerPlain() : | 7 | ViewerPlain::ViewerPlain() : |
8 | bCmdClean( true ), | ||
9 | bRunClean( true ) | 8 | bRunClean( true ) |
10 | { | 9 | { |
11 | } | 10 | } |
@@ -16,29 +15,50 @@ ViewerPlain::~ViewerPlain() | |||
16 | 15 | ||
17 | void ViewerPlain::beginCommand( Action::eAction nAct, const std::string &sTarget ) | 16 | void ViewerPlain::beginCommand( Action::eAction nAct, const std::string &sTarget ) |
18 | { | 17 | { |
19 | bCmdClean = true; | 18 | Cmd cmd; |
20 | this->sTarget = sTarget; | 19 | if( sCmd.empty() ) |
20 | cmd.nLevel = 0; | ||
21 | else | ||
22 | cmd.nLevel = sCmd.front().nLevel+1; | ||
23 | |||
24 | cmd.bCmdClean = true; | ||
25 | cmd.sTarget = sTarget; | ||
26 | |||
27 | sCmd.push_front( cmd ); | ||
21 | } | 28 | } |
22 | 29 | ||
23 | void ViewerPlain::endCommand() | 30 | void ViewerPlain::endCommand() |
24 | { | 31 | { |
25 | if( bCmdClean == false ) | 32 | if( sCmd.front().bCmdClean == false ) |
26 | printf("\n"); | 33 | printf("\n"); |
34 | sCmd.pop_front(); | ||
35 | } | ||
36 | |||
37 | void ViewerPlain::indent() | ||
38 | { | ||
39 | if( sCmd.empty() ) return; | ||
40 | int jmax = sCmd.front().nLevel; | ||
41 | for( int j = 0; j < jmax; j++ ) | ||
42 | { | ||
43 | printf(" "); | ||
44 | } | ||
27 | } | 45 | } |
28 | 46 | ||
29 | void ViewerPlain::printHead() | 47 | void ViewerPlain::printHead() |
30 | { | 48 | { |
31 | if( bCmdClean == true ) | 49 | if( sCmd.front().bCmdClean == true ) |
32 | { | 50 | { |
33 | bRunClean = false; | 51 | bRunClean = false; |
34 | bCmdClean = false; | 52 | sCmd.front().bCmdClean = false; |
35 | printf("--- %s ---\n", sTarget.c_str() ); | 53 | indent(); |
54 | printf("--- %s ---\n", sCmd.front().sTarget.c_str() ); | ||
36 | } | 55 | } |
37 | } | 56 | } |
38 | 57 | ||
39 | void ViewerPlain::beginRequiresCheck( bool bCached, const std::string &sName ) | 58 | void ViewerPlain::beginRequiresCheck( bool bCached, const std::string &sName ) |
40 | { | 59 | { |
41 | printHead(); | 60 | printHead(); |
61 | indent(); | ||
42 | printf(" deps: %s\n", sName.c_str() ); | 62 | printf(" deps: %s\n", sName.c_str() ); |
43 | } | 63 | } |
44 | 64 | ||
@@ -49,6 +69,7 @@ void ViewerPlain::endRequiresCheck() | |||
49 | void ViewerPlain::beginPerform( Perform *pPerform ) | 69 | void ViewerPlain::beginPerform( Perform *pPerform ) |
50 | { | 70 | { |
51 | printHead(); | 71 | printHead(); |
72 | indent(); | ||
52 | printf(" %8s: %s\n", pPerform->getRule().c_str(), pPerform->getTarget().c_str() ); | 73 | printf(" %8s: %s\n", pPerform->getRule().c_str(), pPerform->getTarget().c_str() ); |
53 | } | 74 | } |
54 | 75 | ||