Dictionary Class

This is Dictionary class (as in the .NET one) for C++. It is open to any fixes.

Documentation
None yet.

Code
/* Dictionary Class

This is released under Matthew's Code License (See Below)

MATTHEW'S CODE LICENSE

This license will be removed once implemented into your code, it is relicensed under your program's one, be it proprietary or free.

Note that std::map is vastly faster, provides iterator and is part of the standard, there isn't any reason to ever use this class.




 * 1) ifndef DICTIONARY_H
 * 2) define DICTIONARY_H


 * 1) include

namespace std{ template class Dictionary {		protected: vector<_key> keyList; vector<_value> valueList; template unsigned int tFindKey(vector<_search> searchList, _search keyName) {			for(unsigned int i=0;i vector tFindKeys(vector<_search> searchList, vector<_search> keyNames) {			unsigned int j;			vector returnValue; for(unsigned int i=0;i(keyList, keyName); }		vector pFindKeys(vector<_key> keyNames) {			return tFindKeys<_key>(keyList, keyNames); }		unsigned int pFindValue(_value dataName) {			return tFindKey<_value>(valueList, dataName); }		vector pFindValues(vector<_value> dataNames) {			return tFindKeys<_value>(valueList, dataNames); }		_value& pReadKey(_key keyName) {			unsigned int i = pFindKey(keyName); if (i == KeyNotFound) throw KeyNotFoundException; else return valueList[i]; }		bool pAddKey(_key keyName, _value keyValue) {			unsigned int i = pFindKey(keyName); if (i == KeyNotFound) {				keyList.push_back(keyName); valueList.push_back(keyValue); return true; }			else {				throw KeyAlreadyExistsException; }		}		public: const static unsigned int KeyNotFoundException = 32767, KeyAlreadyExistsException = 32768; Dictionary {		}		_value& Item(_key keyName) {			return pReadKey(keyName); }		_value& operator[](_key keyName) {			return pReadKey(keyName); }		bool ContainsKey(_key keyName) {			return pFindKey(keyName) != KeyNotFound; }		bool ContainsValue(_value dataName) {			return pFindValue(dataName) != KeyNotFound; }		bool AddKey(_key keyName, _value keyData) {			return pAddKey(keyName, keyData); }		vector<_key> Items(void) {			return keyList; }		bool RemoveKey(_key keyName) {			unsigned int f = pFindKey(keyName); vector<_key> newKey; vector<_value> newValue; if (f == KeyNotFound) throw KeyNotFoundException; else {				for(unsigned int i=0;i keyNames) {			vector keyIndexes; vector<_key> newKey; vector<_value> newValue; keyIndexes = tFindKeys<_key>(keyList, keyNames); unsigned int i, j;			bool addItem; for(i=0;i<keyList.size;i++) {				addItem = true; for(j=0;j<keyIndexes.size;j++) {					if (keyList[i] == keyIndexes[j]) {						addItem = false; break; }				}				if (addItem) {					newKey.push_back(keyList[i]); newValue.push_back(valueList[i]); }			}			keyList = newKey; valueList = newValue; return true; }		unsigned int KeyNotFound(void) {			return keyList.max_size+1; }	}; }


 * 1) endif