X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=website%2Farchive%2Fbinaries%2Fmac%2Fsrc%2Fclustalw%2Fsrc%2Fgeneral%2FUtility.h;fp=website%2Farchive%2Fbinaries%2Fmac%2Fsrc%2Fclustalw%2Fsrc%2Fgeneral%2FUtility.h;h=b3371e63cd0b7269092eb4597d6cf22943d9158f;hb=dbde3fb6f00b9bb770343631a517c0e599db8528;hp=0000000000000000000000000000000000000000;hpb=85f830bbd51a7277994bd4233141016304e210c9;p=jabaws.git diff --git a/website/archive/binaries/mac/src/clustalw/src/general/Utility.h b/website/archive/binaries/mac/src/clustalw/src/general/Utility.h new file mode 100644 index 0000000..b3371e6 --- /dev/null +++ b/website/archive/binaries/mac/src/clustalw/src/general/Utility.h @@ -0,0 +1,73 @@ +/** + * Author: Mark Larkin + * + * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. + */ +#ifndef UTILITY_H +#define UTILITY_H + +#include +#include +#include +#include +#include +#include +#include "clustalw.h" +class QLabel; +using namespace std; + +namespace clustalw +{ +class Utility +{ + public: + Utility(); + virtual ~Utility(){}; + + char* rTrim(char *str); + void rTrim(string *str); + char* blankToUnderscore(char *str); + string blankToUnderscore(string str); + void getStr(string instr, string& outstr); + char getChoice(string instr); + double getReal(const char *instr, double minx, double maxx, double def); + int getInt(const char *instr,int minx,int maxx, int def); + unsigned long getUniqueSequenceIdentifier(); + bool lineType(char *line, const char *code); + + bool blankLine(char *line); + + void getPath(string str, string *path); + + virtual char promptForYesNo(char *title, const char *prompt); + virtual char promptForYesNo(const char *title, const char *prompt); + virtual void error( char *msg,...); + virtual void error( const char *msg,...); + virtual void warning( char *msg,...); + virtual void warning( const char *msg,...); + virtual void info( char *msg,...); + virtual void info( const char *msg,...); + virtual void myname( char *myname ); + template T MIN(T x, T y){if (x <= y){return x;}return y;} + template T MAX(T x, T y){if (x >= y){return x;}return y;} + // Note the following function will never be used from this class. It is for the + // QT version. I need it here so that I can add the function to QTUtility. + virtual void setInfoLabelPtr(QLabel* ptrToLabelObj); + bool isNumeric(char ch); + double average(std::vector& v); + double stdDev(std::vector& v); + double median(std::vector v); + /* Attributes */ + void beQuiet(bool b) {quiet=b;}; + + private: + /* Functions */ + + + /* Attributes */ + bool quiet; + +}; +} +#endif +