24 #if defined(OLD_STDCPP) || defined(NEW_STDCPP)
25 #ifndef _UCOMMON_STREAM_H_
26 #define _UCOMMON_STREAM_H_
28 #ifndef _UCOMMON_CONFIG_H
32 #ifndef _UCOMMON_PROTOCOLS_H_
36 #ifndef _UCOMMON_THREAD_H_
40 #ifndef _UCOMMON_SOCKET_H_
44 #ifndef _UCOMMON_FSYS_H_
48 #ifndef _UCOMMON_SHELL_H_
62 class __EXPORT
StreamBuffer :
protected std::streambuf,
public std::iostream
82 void allocate(
size_t size);
91 inline bool is_open(
void)
94 inline operator bool()
97 inline bool operator!()
98 {
return bufsize == 0;}
112 __LOCAL
void allocate(
unsigned size);
113 __LOCAL
void reset(
void);
119 virtual ssize_t _read(
char *buffer,
size_t size);
121 virtual ssize_t _write(
const char *buffer,
size_t size);
123 virtual bool _wait(
void);
144 int overflow(
int ch);
146 inline socket_t getsocket(
void)
const
190 inline operator bool()
const
191 {
return so != INVALID_SOCKET && bufsize > 0;};
197 inline bool operator!()
const
198 {
return so == INVALID_SOCKET || bufsize == 0;};
213 void open(
const char *host,
const char *service,
unsigned segment = 536);
240 __LOCAL
void allocate(
size_t size, access_t mode);
266 int overflow(
int ch);
282 pipestream(
const char *command, access_t
access,
char **args,
char **env = NULL,
size_t size = 512);
293 inline operator bool()
const
294 {
return (bufsize > 0);};
300 inline bool operator!()
const
301 {
return bufsize == 0;};
311 void open(
const char *path, access_t access,
char **args,
char **env = NULL,
size_t buffering = 512);
322 void terminate(
void);
324 inline void cancel(
void)
367 int overflow(
int ch);
399 inline operator bool()
const
400 {
return (bufsize > 0);};
406 inline bool operator!()
const
407 {
return bufsize == 0;};
412 void open(
const char *filename,
fsys::access_t access,
size_t buffering = 512);
417 void open(
const char *filename,
unsigned mode,
fsys::access_t access,
size_t buffering = 512);
433 inline int err(
void)
const
447 static std::ostream& print(std::ostream& out,
const PrintProtocol& format);
449 static std::istream& input(std::istream& inp,
InputProtocol& format);
451 static std::ostream& print(std::ostream& out,
const string_t& str);
453 static std::istream& input(std::istream& inp,
string_t& str);
455 static std::ostream& print(std::ostream& out,
const stringlist_t& list);
457 static std::istream& input(std::istream& in,
stringlist_t& list);
462 {
return _stream_operators::print(out, format);}
464 inline std::istream&
operator>> (std::istream& inp, InputProtocol& format)
465 {
return _stream_operators::input(inp, format);}
468 {
return _stream_operators::print(out, str);}
471 {
return _stream_operators::input(inp, str);}
474 {
return _stream_operators::print(out, list);}
477 {
return _stream_operators::input(in, list);}