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;};
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);};
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);};
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);}
Streamable tcp connection between client and server.
Used for processing input.
A container for generic and o/s portable threadsafe file system functions.
Streamable tcp connection between client and server.
String string_t
A convenience type for string.
Various miscellaneous platform specific headers and defines.
At least with gcc, linking of stream operators was broken.
long offset_t
File offset type.
bool operator!() const
See if stream is disconnected.
String pager for storing lists of NULL terminated strings.
void access(SharedAccess &object)
Convenience function to access (lock) shared object through it's protocol.
Streamable tcp connection between client and server.
bool operator!() const
See if stream is disconnected.
A generic tcp server class.
Thread-aware file system manipulation class.
A generic socket address class.
Common socket class and address manipulation.
Used for forming stream output.
ObjectProtocol * copy(ObjectProtocol *object)
Convenience function to access object copy.
Common stream buffer for std C++ i/o classes.
PersistEngine & operator>>(PersistEngine &ar, PersistObject &ob)
void release(SharedAccess &object)
Convenience function to unlock shared object through it's protocol.
unsigned long timeout_t
Typedef for millisecond timer values.
StringPager stringlist_t
A convenience type for paged string lists.
Thread classes and sychronization objects.
A copy-on-write string class that operates by reference count.
PersistEngine & operator<<(PersistEngine &ar, PersistObject const &ob)
access_t
Enumerated file access modes.
int err(void) const
Get error flag from last i/o operation.
Generic shell parsing and application services.
Abstract interfaces and support.
bool operator!() const
See if stream is disconnected.