#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;
ACE_Allocator *alloc (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_;
inline ACE_UNIMPLEMENTED_FUNC ( void operator= (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);
char *read (
int terminator = EOF,
int search = '\n',
int replace = ' '
);
ACE_Allocator::malloc
to 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 byte of data is a 0, so that
strlen
can be used on it. The caller is responsible for
freeing the pointer returned from this method using the
ACE_Allocator::free
.
size_t replaced (void) const;
read
.
size_t size (void) const;
read
, not including the null terminator.
ACE_Allocator *alloc (void) const;
void dump (void) const;
inline ACE_UNIMPLEMENTED_FUNC (
void operator= (const ACE_Read_Buffer &)
);