X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=mothurout.h;h=a1d950661d8d0f3f8084859a85110db97846cd4d;hb=5d6d303e481489e226fdf8d6c5385b99b50718bc;hp=d2ba6b94f0b12a6bd31df7763e0d4b32d705d3ea;hpb=e189982e0a9b7352ad57cc38ccee675f128be22e;p=mothur.git diff --git a/mothurout.h b/mothurout.h index d2ba6b9..a1d9506 100644 --- a/mothurout.h +++ b/mothurout.h @@ -1,46 +1,112 @@ -#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(); - - 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; }; - ~MothurOut(); - - string logFileName; - ofstream out; - -}; -/***********************************************/ - -#endif - +#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 divideFile(string, int&); + vector setFilePosEachLine(string, int&); + vector 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); + bool inUsersGroups(vector, vector); + bool inUsersGroups(string, vector); + 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&); + void splitAtDash(string&, set&); + void splitAtDash(string&, set&); + void splitAtDash(string&, vector&); + void splitAtChar(string&, vector&, char); + + //math operation + int factorial(int num); + vector > binomial(int); + float ceilDist(float, int); + float roundDist(float, int); + unsigned int fromBase36(string); + + 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 +