X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=mothurout.h;h=12de987e231247a4fb195aef20054bd94dacd375;hb=597560b3c23f03d0069082cf096ce65e0c087519;hp=e61490267270680e6800cfa31a68b47cb1bbbbc3;hpb=88fbc534a92cb91900e98a3288dfa1f68828b69b;p=mothur.git diff --git a/mothurout.h b/mothurout.h index e614902..12de987 100644 --- a/mothurout.h +++ b/mothurout.h @@ -12,6 +12,22 @@ #include "mothur.h" +/***********************************************/ +struct logger { + + logger() {} + ~logger() {} + + template< class T > + logger& operator <<( const T& o ) { + cout << o; return *this; + } + + logger& operator<<(ostream& (*m)(ostream&) ) { + cout << m; return *this; + } + +}; /***********************************************/ class MothurOut { @@ -53,7 +69,7 @@ class MothurOut { vector binLabelsInFile; vector currentBinLabels; string saveNextLabel, argv, sharedHeaderMode; - bool printedHeaders; + bool printedHeaders, commandInputsConvertError; //functions from mothur.h //file operations @@ -84,6 +100,9 @@ class MothurOut { int readNames(string, map >&); int readNames(string, vector&, map&); int mothurRemove(string); + bool mothurConvert(string, int&); //use for converting user inputs. Sets commandInputsConvertError to true if error occurs. Engines check this. + bool mothurConvert(string, float&); //use for converting user inputs. Sets commandInputsConvertError to true if error occurs. Engines check this. + bool mothurConvert(string, double&); //use for converting user inputs. Sets commandInputsConvertError to true if error occurs. Engines check this. //searchs and checks @@ -94,8 +113,10 @@ class MothurOut { void getNumSeqs(ifstream&, int&); int getNumSeqs(ifstream&); int getNumNames(string); + int getNumChar(string, char); bool isTrue(string); bool isContainingOnlyDigits(string); + bool isNumeric1(string); //string manipulation @@ -197,6 +218,7 @@ class MothurOut { flowfile = ""; gui = false; printedHeaders = false; + commandInputsConvertError = false; sharedHeaderMode = ""; } ~MothurOut();