Ok, I think I have decided on the final implementation:
http://www.ampaste.net/11424
It will be completely string-based, with the ability to serialize data into it using 'PackCookie' and 'UnpackCookie'.
Here are the prototypes along with examples:
Code:
/**
* Serialize data to the cookie's string
*
* Symbol Representation
* i var
* f Float:var
* s String:var[]
* b bool:var
*
* Example:
* new String:name[] = "Maggie";
* new height = 32;
* new Float:weight = 19;
* new bool:female = true;
* PackCookie(dogProperties, "sifb", name, height, weight, female);
*
* @param cookie Handle to the cookie
* @param format Formatting rules
* @param ... Variables corresponding to the format to be written
* @return How many variables were read from
*/
native PackCookie(Handle:cookie, const String:format[], any:...);
/**
* Sets the expiration time of the cookie
*
* Symbol Representation
* i var
* f Float:var
* s# String:var[#]
* b bool:var
*
* Example:
* new String:name[50];
* new height;
* new Float:weight;
* new bool:female;
* UnpackCookie(dogProperties, "s50ifb", name, &height, &weight, &female);
*
* @param cookie Handle to the cookie
* @param format Formatting rules
* @param ... Variables corresponding to the format to be written (must be able to reference)
* @return How many variables were written to
*/
native UnpackCookie(Handle:cookie, const String:format[], any:...);
Let me know what you all think.
__________________