#include <ace/Read_Buffer.h>
class ACE_Read_Buffer {
public:
ACE_Read_Buffer ( FILE *fp, int close_on_delete = 0, ACE_Allocator * = 0 );
ACE_Read_Buffer ( ACE_HANDLE handle, int close_on_delete = 0, ACE_Allocator * = 0 );
~ACE_Read_Buffer (void);
char *read ( int terminator = EOF, int search = '\n', int replace = ' ' );
size_t replaced (void) const;
size_t size (void) const;
void dump (void) const;
private:
char *rec_read (int term, int search, int replace);
size_t size_;
size_t occurrences_;
FILE *stream_;
int close_on_delete_;
ACE_Allocator *allocator_;
void operator= (const ACE_Read_Buffer &);
ACE_Read_Buffer (const ACE_Read_Buffer &);
};
ACE_Read_Buffer (
FILE *fp,
int close_on_delete = 0,
ACE_Allocator * = 0
);
ACE_Read_Buffer (
ACE_HANDLE handle,
int close_on_delete = 0,
ACE_Allocator * = 0
);
~ACE_Read_Buffer (void);
Returns a dynamically allocated pointer to n+1 bytes of data from
the input stream up to (and including) the terminator
. If
search
is = 0 then all occurrences of the search
value are
substituted with the replace
value. The last of the n+1 bytes
of data is a 0, so that if data is test, strlen () can be used on
it.
char *read (
int terminator = EOF,
int search = '\n',
int replace = ' '
);
size_t replaced (void) const;
read
.
size_t size (void) const;
read
,
not including the null terminator.
void dump (void) const;
void operator= (const ACE_Read_Buffer &);
ACE_Read_Buffer (const ACE_Read_Buffer &);