#include<iostream>
#include<algorithm>

#include "nlsr_npl.hpp"

using namespace std;

Npl::Npl(){

}

Npl::~Npl(){

}

static bool
nameCompare(string& s1, string& s2){
	return s1==s2;
}

int
Npl::insertIntoNpl(string& name){
	std::list<string >::iterator it = std::find_if( nameList.begin(), 
								nameList.end(),	
   								bind(&nameCompare, _1 , name));

	if( it != nameList.end() ){
		return -1;
	}

	nameList.push_back(name);
	return 0;

}

int 
Npl::removeFromNpl(string& name)
{
	std::list<string >::iterator it = std::find_if( nameList.begin(), 
								nameList.end(),	
   								bind(&nameCompare, _1 , name));

	if( it != nameList.end() ){
		nameList.erase(it);
	}

	return -1;
}

void
Npl::sortNpl()
{
	nameList.sort();
}

void
Npl::printNpl(){
	int i=1;
	for( std::list<string>::iterator it=nameList.begin(); it != nameList.end(); it++){
		cout<<"Name "<<i<<" : "<<(*it)<<endl;
		i++;
	}
}
