]> git.donarmstrong.com Git - mothur.git/blobdiff - suffixnodes.cpp
fixes while testing 1.33.0
[mothur.git] / suffixnodes.cpp
index 79826ff47d045c5fba48f77b70efbef37bc9c17d..130b2be9166ea28f3e4a54066dc31e6d01afdafb 100644 (file)
@@ -15,7 +15,6 @@
 
 #include "suffixnodes.hpp"
 
-using namespace std;
 
 //********************************************************************************************************************
 
@@ -36,7 +35,7 @@ SuffixNode::SuffixNode(int parent, int start, int end) :
                parentNode(parent),                     //      we store the parent node as an int
                startCharPosition(start),       //      the suffix tree class will hold the sequence that the startCharPosition and 
                endCharPosition(end)            //      endCharPosition indices correspond to
-               {       /*      do nothing      */                      }
+               {       /*      do nothing      */              m = MothurOut::getInstance();   }
 
 
 void SuffixNode::setChildren(char, int)                        {       /*      do nothing      */                      }       //      there's no children in a leaf
@@ -58,14 +57,14 @@ SuffixLeaf::SuffixLeaf(int parent, int start, int end) : SuffixNode(parent, star
 
 void SuffixLeaf::print(string sequence, int nodeNumber){
        
-       cout << this << '\t' << parentNode << '\t' << nodeNumber << '\t' <<
-       -1 << '\t' << startCharPosition << '\t' << endCharPosition << '\t';
+       m->mothurOut(toString(this) + "\t" + toString(parentNode) + "\t" + toString(nodeNumber) + "\t" +
+       toString(-1) + "\t" + toString(startCharPosition) + "\t" + toString(endCharPosition) + "\t");
        
-       cout << '\'';
+       m->mothurOut("/");
        for(int i=startCharPosition;i<=endCharPosition;i++){
-               cout << deCodeSequence(sequence[i]);
+               m->mothurOut(toString(deCodeSequence(sequence[i])));
        }
-       cout << '\'' << endl;
+       m->mothurOut("/");  m->mothurOutEndLine();
 }
 
 //********************************************************************************************************************
@@ -75,14 +74,14 @@ SuffixBranch::SuffixBranch(int parent, int start, int end) : SuffixNode(parent,
 }
        
 void SuffixBranch::print(string sequence, int nodeNumber){                                             //      this method is different that than
-       cout << this << '\t' << parentNode << '\t' << nodeNumber << '\t' <<                     //      of a leaf because it prints out a
-       suffixNode << '\t' << startCharPosition << '\t' << endCharPosition << '\t';     //      value for the suffix node       
+       m->mothurOut(toString(this) + "\t" + toString(parentNode) + "\t" + toString(nodeNumber) + "\t" +                //      of a leaf because it prints out a
+       toString(suffixNode) + "\t" + toString(startCharPosition) + "\t" + toString(endCharPosition) + "\t");  //       value for the suffix node
        
-       cout << '\'';
+       m->mothurOut("/");
        for(int i=startCharPosition;i<=endCharPosition;i++){
-               cout << deCodeSequence(sequence[i]);
+               m->mothurOut(toString(deCodeSequence(sequence[i])));
        }
-       cout << '\'' << endl;
+       m->mothurOut("/");  m->mothurOutEndLine();
 }
 
 //     we can access the children by subtracting '0' from the the char value from the string, the difference is an int