X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=getlistcountcommand.cpp;fp=getlistcountcommand.cpp;h=7757122776136ce25edf778709db6c4102a37b9a;hb=aa9238c0a9e6e7aa0ed8b8b606b08ad4fd7dcfe3;hp=6053f474224368a5b7f786f24237b2c8645ea1e0;hpb=182db2b6f1747bc1e0b8cd3eceec8751abdd31d5;p=mothur.git diff --git a/getlistcountcommand.cpp b/getlistcountcommand.cpp index 6053f47..7757122 100644 --- a/getlistcountcommand.cpp +++ b/getlistcountcommand.cpp @@ -126,12 +126,30 @@ int GetListCountCommand::execute(){ //if the users enters label "0.06" and there is no "0.06" in their file use the next lowest label. set processedLabels; set userLabels = labels; - + + if (m->control_pressed) { + delete read; + delete input; + delete list; + globaldata->gListVector = NULL; + for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } + return 0; + } + while((list != NULL) && ((allLines == 1) || (userLabels.size() != 0))) { if(allLines == 1 || labels.count(list->getLabel()) == 1){ process(list); + + if (m->control_pressed) { + delete read; + delete input; + delete list; + globaldata->gListVector = NULL; + for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } + return 0; + } processedLabels.insert(list->getLabel()); userLabels.erase(list->getLabel()); @@ -144,6 +162,15 @@ int GetListCountCommand::execute(){ list = input->getListVector(lastLabel); process(list); + + if (m->control_pressed) { + delete read; + delete input; + delete list; + globaldata->gListVector = NULL; + for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } + return 0; + } processedLabels.insert(list->getLabel()); userLabels.erase(list->getLabel()); @@ -177,11 +204,22 @@ int GetListCountCommand::execute(){ if (list != NULL) { delete list; } list = input->getListVector(lastLabel); - process(list); + process(list); + + if (m->control_pressed) { + delete read; + delete input; + delete list; + globaldata->gListVector = NULL; + for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } + return 0; + } + delete list; } delete read; + delete input; globaldata->gListVector = NULL; m->mothurOutEndLine(); @@ -211,6 +249,8 @@ void GetListCountCommand::process(ListVector* list) { //for each bin in the list vector for (int i = 0; i < list->getNumBins(); i++) { + if (m->control_pressed) { break; } + binnames = list->get(i); out << i+1 << '\t' << binnames << endl; }