HomeProjectsServicesContactus
» Guest
  Sign In     Register    
Projects » CVBuffer
Developer : Ritey
Date : 2005-03-27 00:00

» Summary :

C++ class for a simple dynamic memory buffer.

» Catagories :


  • Development Status: Stable
  • Operating System: Windows
  • Development Environment: MSVC.NET

» Latest Project Downloads:

Total Download Count For Project : 324
 
CVBuffercbuffer.zip
 2005-11-27Source Code3 KbNotes / ChangesMD5:43309befd91250566f8659fcc4a586da324 HitsDownload
 

» Project Information :

Class CvBuffer
<hr>
Class implementing a simple dynamic buffer, using heap memory functions. The buffer is dynamically resized as data is added. This class is thread safe using CriticalSection Objects. The heap is a newly created heap so it is not restricted by the PE header size limits.

Methods:

::Add()
Use this to add data to the end of buffer. It will automatically resize itself.

::Insert()
Insert data into the buffer. Buffer will dynamically resize.

::Remove()
Remove data from the buffer. Buffer will dynamically resize.

::Replace()
Replace exising data in the buffer with new data. The Buffer will dynamically resize if new data is larger than its replacing.

::ChangeSize()
Manually change the size of the buffer.

::Reset()
Clear the buffer and release the memory.

::GetSize()
Get the size of the buffer.

::GetPointer()
Get a pointer to the data in the buffer.

::Find()
Find specific data in the buffer.

::Lock()
::UnLock()
Prevent other threads from accessing the functions.

Sample Usage:
Code:
    CvBuffer mbuf;
    DWORD pos;

    mbuf.Add("Hello My Name Is Rich.",-1);

    printf("%sn",(char*)mbuf.GetPointer());

    pos = mbuf.Find(0,"Is",-1,0);

    mbuf.Replace(pos,2,"WAS",-1);

    printf("%sn",(char*)mbuf.GetPointer());

This will produce the output:-
Hello My Name Is Rich.
Hello My Name WAS Rich.

This example showed the use of strings but the same applies for any type of data.
0 member(s), 15 guest(s)
| Site Map | Statistics | Terms of Use | Privacy Policy |
Copyright (C) GoCoding.Com 2004-2007
Powered by Seditio
Contacts