general/buffer.h

Go to the documentation of this file.
00001 /* $Id: buffer.hpp jjs $ */
00002 /*
00003    Copyright (C) 2007 by Jurjen Stellingwerff <jurjen@stwerff.xs4all.nl>
00004    Part of the Moros Project http://moros.sourceforge.net/
00005 
00006    This program is free software; you can redistribute it and/or modify
00007    it under the terms of the GNU General Public License.
00008    This program is distributed in the hope that it will be useful,
00009    but WITHOUT ANY WARRANTY.
00010 
00011    See the COPYING file for more details.
00012 */
00013 #ifndef __BUFFER_H
00014 #define __BUFFER_H
00015 
00022 
00023 
00027 #include <string>
00028 
00029 class buffer {
00030     private:
00031 
00032     char* data_;    
00033     unsigned long size_;     
00034     unsigned long read_pos_; 
00035     unsigned long last_pos_; 
00036     unsigned long write_pos_;
00037 
00039     std::string debug_(int pos, int len);
00040 
00041     public:
00042     buffer(void);
00043     ~buffer(void);
00044 
00046 
00049     void write(const std::string data);
00051     int fwrite(int fd);
00052 
00054     char* writing(int bytes);
00055 
00057     void wrote(int bytes);
00058 
00060     char *send(long *length);
00061 
00063     unsigned long bytes(void);
00065     char* ptr(void);
00067     void done(unsigned long bytes);
00068 };
00069 
00070 #endif // __BUFFER_H


Generated on Tue Jan 1 17:30:00 2008 for general/buffer.h Source File by  doxygen   Visit the project page on SourceForge.net Logo