Functions

FileIO; Prefer @ref StrBuf_BufferedIO
[Stringbuffer, A class for manipulating strings with dynamic buffers]

Functions

int StrBufTCP_read_line (StrBuf *buf, int *fd, int append, const char **Error)
 Read a line from socket flushes and closes the FD on error.
int StrBufReadBLOB (StrBuf *Buf, int *fd, int append, long nBytes, const char **Error)
 Input binary data from socket flushes and closes the FD on error.
int StrBufSipLine (StrBuf *LineBuf, StrBuf *Buf, const char **Ptr)
 extract a "next line" from Buf; Ptr to persist across several iterations
void StrBufStripSlashes (StrBuf *Dir, int RemoveTrailingSlash)
 removes double slashes from pathnames

Detailed Description

Slow I/O; avoid.


Function Documentation

int StrBufReadBLOB ( StrBuf Buf,
int *  fd,
int  append,
long  nBytes,
const char **  Error 
)

Input binary data from socket flushes and closes the FD on error.

Parameters:
Buf the buffer to get the input to
fd pointer to the filedescriptor to read
append Append to an existing string or replace?
nBytes the maximal number of bytes to read
Error strerror() on error
Returns:
numbers of chars read
int StrBufSipLine ( StrBuf LineBuf,
StrBuf Buf,
const char **  Ptr 
)

extract a "next line" from Buf; Ptr to persist across several iterations

Parameters:
LineBuf your line will be copied here.
Buf BLOB with lines of text...
Ptr moved arround to keep the next-line across several iterations has to be &NULL on start; will be &NotNULL on end of buffer
Returns:
size of copied buffer
void StrBufStripSlashes ( StrBuf Dir,
int  RemoveTrailingSlash 
)

removes double slashes from pathnames

Parameters:
Dir directory string to filter
RemoveTrailingSlash allows / disallows trailing slashes
int StrBufTCP_read_line ( StrBuf buf,
int *  fd,
int  append,
const char **  Error 
)

Read a line from socket flushes and closes the FD on error.

Parameters:
buf the buffer to get the input to
fd pointer to the filedescriptor to read
append Append to an existing string or replace?
Error strerror() on error
Returns:
numbers of chars read
 All Classes Variables