All pastes #955947 Raw Edit

dennis

public text v1 · immutable
#955947 ·published 2008-03-24 22:50 UTC
rendered paste body
string ArrayMaster::returnBoxContents(bool detailed, int menuChoice, bool all){
    stringstream itemInformation;
    do{
        if ((pitem[menuChoice]!=NULL) && ((menuChoice>(-1)) && (menuChoice<returnCapacity()-1))){//remove
            itemInformation <<"\nItem Number: "<<menuChoice<<endl;                      //this now
            itemInformation <<"Catagory: "<<(*pitem)[menuChoice].getcatagory()<<endl;//
            if (detailed == true){
                itemInformation <<"Description: "<<(*pitem)[menuChoice].getdescription()<<endl;
                itemInformation <<"Priority: "<<(*pitem)[menuChoice].getpriority()<<endl;
            }
        return itemInformation.str();
        }
        else{ itemInformation <<"\nItem "<<menuChoice<<" is blank!"<<endl;
        }
        menuChoice+=1;
        if (menuChoice==returnCapacity()){
            all=0;
        }
    }while (all==1);
}

void ArrayMaster::deleteItem(int focus){
    int shifts=returnCapacity()-focus;//shifts is the number of times to redirect pointers
    for(int i=1;i<shifts;i++){
        pitem[focus] = pitem[focus++];
    }
    pitem[focus] = NULL;
    //resize (&returnCapacity, returnCapacity-1);//brokkkkkeeee
}
void ArrayMaster::loadFile(){
    ifstream inStream;
    inStream.open("defaultSettingFile.txt");
    string catagory, description, priority;
    while(!inStream.eof()){
        inStream >>catagory>>description>>priority;
        storeItem(catagory,description, priority);
    }
    inStream.close();
}