root/week1oplossing/KeyValueLijst.h

User picture

Author: machiel.sleeuwaert

Revision: 13 («Previous)

(Oct 15 14:12 2008 UTC) Over 3 years ago


  

 
Show/hide line numbers
#pragma once
#include "GameDefines.h"
#include "KeyValuePaar.h"

class KeyValueLijst
{
public:
	KeyValueLijst();
	virtual ~KeyValueLijst();

	// Voeg toe op het einde van de lijst
	void insert(KeyValuePaar value); 
	// Vind de item volgens een key en geef de waarde terug
	tstring find(tstring key);
	// Verander de waarde van een element met een bepaalde key
	void change(tstring key, tstring newvalue);
	// Wis een waarde
	void erase(tstring key);
	
	static const int BASE_SIZE=10;


	KeyValueLijst(const KeyValueLijst& p);							
	KeyValueLijst& operator=(const KeyValueLijst& p);
	KeyValueLijst operator+(const KeyValueLijst& p);
	KeyValueLijst& operator+=(const KeyValueLijst& p);
	bool operator==(const KeyValueLijst& p);
	bool operator!=(const KeyValueLijst& p);
	void operator>>(tstringstream &p);

private:
	void vergrootArray();

	int m_AantalElementen,m_Capaciteit;

	KeyValuePaar* m_KeyValueArrPtr;

	
};