]> git.donarmstrong.com Git - mothur.git/blobdiff - mothurout.h
added pipeline commands which involved change to command factory and command class...
[mothur.git] / mothurout.h
index d2ba6b94f0b12a6bd31df7763e0d4b32d705d3ea..9921a40dccec386ad1266e9954ed72686f7be130 100644 (file)
-#ifndef MOTHUROUT_H\r
-#define MOTHUROUT_H\r
-\r
-/*\r
- *  mothurOut.h\r
- *  Mothur\r
- *\r
- *  Created by westcott on 2/25/10.\r
- *  Copyright 2010 Schloss Lab. All rights reserved.\r
- *\r
- */\r
-\r
-#include "mothur.h"\r
-\r
-/***********************************************/\r
-\r
-class MothurOut {\r
-       \r
-       public:\r
-               static MothurOut* getInstance();\r
-               void setFileName(string);\r
-               \r
-               void mothurOut(string);\r
-               void mothurOutEndLine();\r
-               void mothurOutJustToLog(string);\r
-               void errorOut(exception&, string, string);\r
-               void closeLog();\r
-\r
-               int control_pressed;\r
-               bool executing;\r
-\r
-       private:\r
-               static MothurOut* _uniqueInstance;\r
-               MothurOut( const MothurOut& ); // Disable copy constructor\r
-               void operator=( const MothurOut& ); // Disable assignment operator\r
-               MothurOut() { control_pressed = false; };\r
-               ~MothurOut();\r
-\r
-               string logFileName;\r
-               ofstream out;\r
-\r
-};\r
-/***********************************************/\r
-\r
-#endif\r
-\r
+#ifndef MOTHUROUT_H
+#define MOTHUROUT_H
+
+/*
+ *  mothurOut.h
+ *  Mothur
+ *
+ *  Created by westcott on 2/25/10.
+ *  Copyright 2010 Schloss Lab. All rights reserved.
+ *
+ */
+
+#include "mothur.h"
+
+/***********************************************/
+
+class MothurOut {
+       
+       public:
+               static MothurOut* getInstance();
+               void setFileName(string);
+               
+               void mothurOut(string);
+               void mothurOutEndLine();
+               void mothurOutJustToLog(string);
+               void errorOut(exception&, string, string);
+               void closeLog();
+               string getDefaultPath() { return defaultPath; }
+               void setDefaultPath(string);
+               string getOutputDir() { return outputDir; }
+               void setOutputDir(string);
+               
+               string getReleaseDate() { return releaseDate; }
+               void setReleaseDate(string r) { releaseDate = r; }
+               string getVersion() { return version; }
+               void setVersion(string r) { version = r; }
+               
+               //functions from mothur.h
+               //file operations
+               vector<unsigned long int> divideFile(string, int&);
+               vector<unsigned long int> setFilePosEachLine(string, int&);
+               vector<unsigned long int> setFilePosFasta(string, int&);
+               string sortFile(string, string);
+               void appendFiles(string, string);
+               int renameFile(string, string); //oldname, newname
+               string getFullPathName(string);
+               string hasPath(string);
+               string getExtension(string);
+               string getPathName(string);
+               string getSimpleName(string);
+               string getRootName(string);
+               bool isBlank(string);
+               int openOutputFile(string, ofstream&);
+               int openOutputFileAppend(string, ofstream&);
+               int openInputFile(string, ifstream&);
+               int openInputFile(string, ifstream&, string); //no error given 
+               string getline(ifstream&);
+               string getline(istringstream&);
+               void gobble(istream&);
+               void gobble(istringstream&);
+               
+               //searchs and checks
+               bool checkReleaseVersion(ifstream&, string);
+               bool anyLabelsToProcess(string, set<string>&, string);
+               bool inUsersGroups(vector<string>, vector<string>);
+               bool inUsersGroups(string, vector<string>);
+               void getNumSeqs(ifstream&, int&);
+               int getNumSeqs(ifstream&);
+               int getNumNames(string);
+               bool isTrue(string);
+       
+               
+               //string manipulation
+               void splitAtEquals(string&, string&);
+               void splitAtComma(string&, string&);    
+               void splitAtComma(string&, vector<string>&);
+               void splitAtDash(string&, set<int>&);
+               void splitAtDash(string&, set<string>&);
+               void splitAtDash(string&, vector<string>&);
+               void splitAtChar(string&, vector<string>&, char);
+               
+               //math operation
+               int factorial(int num);
+               vector<vector<double> > binomial(int);
+               float ceilDist(float, int);
+               float roundDist(float, int);
+
+               int control_pressed;
+               bool executing;
+               
+
+       private:
+               static MothurOut* _uniqueInstance;
+               MothurOut( const MothurOut& ); // Disable copy constructor
+               void operator=( const MothurOut& ); // Disable assignment operator
+               MothurOut() { control_pressed = false; defaultPath=""; };
+               ~MothurOut();
+
+               string logFileName;
+               string defaultPath, outputDir;
+               string releaseDate, version;
+               
+               ofstream out;
+               
+               int mem_usage(double&, double&);
+
+};
+/***********************************************/
+
+#endif
+