/***********************************************************************/
InputData::InputData(string fName, string f) : format(f){
-
+ m = MothurOut::getInstance();
openInputFile(fName, fileHandle);
filename = fName;
InputData::InputData(string fName, string orderFileName, string f) : format(f){
try {
-
+ m = MothurOut::getInstance();
ifstream ofHandle;
openInputFile(orderFileName, ofHandle);
string name;
openInputFile(fName, fileHandle);
}
catch(exception& e) {
- errorOut(e, "InputData", "InputData");
+ m->errorOut(e, "InputData", "InputData");
exit(1);
}
}
ListVector* InputData::getListVector(){
try {
- if(fileHandle){
+ if(!fileHandle.eof()){
if(format == "list") {
list = new ListVector(fileHandle);
}else{ list = NULL; }
}
}
catch(exception& e) {
- errorOut(e, "InputData", "getListVector");
+ m->errorOut(e, "InputData", "getListVector");
exit(1);
}
}
/***********************************************************************/
-
ListVector* InputData::getListVector(string label){
try {
ifstream in;
}
}
catch(exception& e) {
- errorOut(e, "InputData", "getListVector");
+ m->errorOut(e, "InputData", "getListVector");
exit(1);
}
}
+/***********************************************************************/
+ListVector* InputData::getListVector(string label, bool resetFP){
+ try {
+ string thisLabel;
+ fileHandle.clear();
+ fileHandle.seekg(0);
+
+ if(fileHandle){
+ if (format == "list") {
+
+ while (fileHandle.eof() != true) {
+
+ list = new ListVector(fileHandle); gobble(fileHandle);
+ thisLabel = list->getLabel();
+
+ //if you are at the last label
+ if (thisLabel == label) { break; }
+ //so you don't loose this memory
+ else { delete list; }
+ }
+ }else{ list = NULL; }
+
+ return list;
+ }
+ else{
+ return NULL;
+ }
+ }
+ catch(exception& e) {
+ m->errorOut(e, "InputData", "getListVector");
+ exit(1);
+ }
+}
/***********************************************************************/
}
}
catch(exception& e) {
- errorOut(e, "InputData", "getSharedListVector");
+ m->errorOut(e, "InputData", "getSharedListVector");
exit(1);
}
}
}
}
catch(exception& e) {
- errorOut(e, "InputData", "getSharedListVector");
+ m->errorOut(e, "InputData", "getSharedListVector");
exit(1);
}
}
}
}
catch(exception& e) {
- errorOut(e, "InputData", "getSharedOrderVector");
+ m->errorOut(e, "InputData", "getSharedOrderVector");
exit(1);
}
}
}
}
catch(exception& e) {
- errorOut(e, "InputData", "getSharedOrderVector");
+ m->errorOut(e, "InputData", "getSharedOrderVector");
exit(1);
}
}
}
}
catch(exception& e) {
- errorOut(e, "InputData", "getOrderVector");
+ m->errorOut(e, "InputData", "getOrderVector");
exit(1);
}
}
}
}
catch(exception& e) {
- errorOut(e, "InputData", "getOrderVector");
+ m->errorOut(e, "InputData", "getOrderVector");
exit(1);
}
}
}
catch(exception& e) {
- errorOut(e, "InputData", "getSharedRAbundVectors");
+ m->errorOut(e, "InputData", "getSharedRAbundVectors");
exit(1);
}
}
}
catch(exception& e) {
- errorOut(e, "InputData", "getSharedRAbundVectors");
+ m->errorOut(e, "InputData", "getSharedRAbundVectors");
exit(1);
}
}
}
}
catch(exception& e) {
- errorOut(e, "InputData", "getSAbundVector");
+ m->errorOut(e, "InputData", "getSAbundVector");
exit(1);
}
}
}
}
catch(exception& e) {
- errorOut(e, "InputData", "getSAbundVector");
+ m->errorOut(e, "InputData", "getSAbundVector");
exit(1);
}
}
}
}
catch(exception& e) {
- errorOut(e, "InputData", "getRAbundVector");
+ m->errorOut(e, "InputData", "getRAbundVector");
exit(1);
}
}
}
}
catch(exception& e) {
- errorOut(e, "InputData", "getRAbundVector");
+ m->errorOut(e, "InputData", "getRAbundVector");
exit(1);
}
}