Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
Buffer.cpp
Package: 视频会议系统.rar [view]
Upload User: popouu88
Upload Date: 2013-02-11
Package Size: 2894k
Code Size: 1k
Category:
VOIP program
Development Platform:
Visual C++
- // Buffer.cpp: implementation of the CBuffer1 class.
- //
- //////////////////////////////////////////////////////////////////////
- #include "Buffer.h"
- #include <memory.h>
- //////////////////////////////////////////////////////////////////////
- // Construction/Destruction
- //////////////////////////////////////////////////////////////////////
- CBuffer::CBuffer( )
- {
- this->buffer = NULL ;
- this->size = 0;
- }
- CBuffer::CBuffer( int s )
- {
- this->buffer = NULL ;
- this->Resize( s );
- }
- CBuffer::CBuffer( const char * buffer , int size )
- {
- this->buffer = NULL;
- this->Resize( size );
- memcpy( this->buffer , buffer , size );
- }
- const CBuffer & CBuffer::operator =( const CBuffer & b )
- {
- this->Resize( b.size );
- memcpy( this->buffer , b.buffer , b.size );
- return * this;
- }
- CBuffer::~CBuffer( )
- {
- this->Release( );
- }
- void CBuffer::Resize( int size )
- {
- this->Release( );
- if( size > 0 )
- {
- this->size = size;
- this->buffer = new char[ size ];
- }
- }
- void CBuffer::Release( void )
- {
- if( this->buffer )
- {
- try
- {
- delete [ ]this->buffer; this->buffer = NULL;
- }
- catch( ... )
- {
- }
- this->size = 0;
- }
- }