U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » U++ Core » PROPOSAL: small / usefull Stream iface extension
Re: PROPOSAL: small / usefull Stream iface extension [message #27953 is a reply to message #27952] Thu, 12 August 2010 00:14 Go to previous messageGo to previous message
kohait00 is currently offline  kohait00
Messages: 939
Registered: July 2009
Location: Germany
Experienced Contributor
and some 2 more..


	void      PutReserve(byte *& p, dword size = 1) { if(ptr + size <= wrlim) { p = ptr; ptr += size; } else p = NULL; }
	dword     GetReserve(byte *& p, dword size = 1) { if(ptr + size <= rdlim) { p = ptr; ptr += size; return size; } 
														else { dword s = dword((uintptr_t)(rdlim - ptr)); return ((s>0)?(p=ptr,s):(0)); } }



could maybe be named PutShadow, GetShadow, or something, to indicate that the buffer is refered only, no memcpy..
this is usefull to modify the data underneeth directly.
 
Read Message icon3.gif
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: NEW: Tree<T> container
Next Topic: better Stream manual....more info needed
Goto Forum:
  


Current Time: Fri Sep 11 21:59:43 GMT+2 2026

Total time taken to generate the page: 0.00819 seconds