class AkentiOutputStream

An AkentiOutputStream object is used to serialize all types of objects using a simple scheme to write the objects' string reprsentations

Public Methods

AkentiOutputStream (ostream& os)
Constructs this object given an ostream object specified by os
AkentiOutputStream& write (const char *ptr, int n)
AkentiOutputStream& operator<< (char c)
Writes a char to the underlying output stream
AkentiOutputStream& operator<< (int n)
Writes an int to the underlying output stream
AkentiOutputStream& operator<< (bool b)
Writes a bool to the underlying output stream
AkentiOutputStream& operator<< (long l)
Writes a long to the underlying output stream
AkentiOutputStream& operator<< (double d)
Writes a double to the underlying output stream
AkentiOutputStream& operator<< (const string& s)
Writes a string to the underlying output stream
AkentiOutputStream& operator<< (const UtcTime& time)
Writes a UtcTime to the underlying output stream
AkentiOutputStream& operator<< (const URL& url)
Writes a URL to the underlying output stream
AkentiOutputStream& operator<< (const DistinguishedName& dn)
Writes a DistinguishedName to the underlying output stream
AkentiOutputStream& operator<< (const AkentiObject& obj)
Writes an AkentiObject to the underlying output stream

Documentation

An AkentiOutputStream object is used to serialize all types of objects using a simple scheme to write the objects' string reprsentations. For standard C++ types such as int, long, char this class just wraps the ostream methods. For string objects containing blank spaces those spaces are escaped by preceeding them by a back slash. Escaping the blank space allows the deserializing process to distinguish between blank spaces that are part of the object being deserialized and the blank spaces used as delimiters between elements. Only the object is written to the ostream by these methods. The delimiting blank space between the ojbects must be written by the caller of this class. Note: Blank spaces at the beginning and at the end of an object's representation are ignored. Those in the middle are escaped and if there is a sequence of blanks in the middle, only one is escaped and the others are ignored. Example1: "/C=US/CN=John Doe" will be written as "/C=US/CN=John\ Doe" Example2: Deserializing "Hello\ John Bye\ John" will result in two strings "Hello John" and "Bye John" It is recommended to use an AkentiInputStream object to deserialize objects.
AkentiOutputStream(ostream& os)
Constructs this object given an ostream object specified by os. Note that the AkentiOutputStream is only valid as long as the underlying ostream is valid.
Parameters:
os - ostream the underlying output stream

AkentiOutputStream& write(const char *ptr, int n)

AkentiOutputStream& operator<<(char c)
Writes a char to the underlying output stream.
Throws:
IOException if writing fails
Returns:
this AkentiOutputStream for chaining
Parameters:
c - char to be written
See Also:
IOException

AkentiOutputStream& operator<<(int n)
Writes an int to the underlying output stream.
Throws:
IOException if writing fails
Returns:
this AkentiOutputStream for chaining
Parameters:
n - int to be written
See Also:
IOException

AkentiOutputStream& operator<<(bool b)
Writes a bool to the underlying output stream.
Throws:
IOException if writing fails
Returns:
this AkentiOutputStream for chaining
Parameters:
b - bool to be written
See Also:
IOException

AkentiOutputStream& operator<<(long l)
Writes a long to the underlying output stream.
Throws:
IOException if writing fails
Returns:
this AkentiOutputStream for chaining
Parameters:
l - long to be written
See Also:
IOException

AkentiOutputStream& operator<<(double d)
Writes a double to the underlying output stream.
Throws:
IOException if writing fails
Returns:
this AkentiOutputStream for chaining
Parameters:
d - double to be written
See Also:
IOException

AkentiOutputStream& operator<<(const string& s)
Writes a string to the underlying output stream. Blank spaces at the beginning and at the end of the string are ignored. Blanks in the middle are escaped and if there is a sequence of blanks in the middle, only one is escaped and the others are ignored. Examples: "aa bb" => "aa\\ bb" " aa bb " => "aa\\ bb" "aa bb" => "aa\\ bb"
Throws:
IOException if writing fails
Returns:
this AkentiOutputStream for chaining
Parameters:
s - string to be written

AkentiOutputStream& operator<<(const UtcTime& time)
Writes a UtcTime to the underlying output stream.
Throws:
IOException if writing fails
Returns:
this AkentiOutputStream for chaining
Parameters:
time - UtcTime to be written
See Also:
UtcTime for the external format that is used
IOException

AkentiOutputStream& operator<<(const URL& url)
Writes a URL to the underlying output stream.
Throws:
IOException if writing fails
Returns:
this AkentiOutputStream for chaining
Parameters:
url - URL to be written
See Also:
URL for the external format that is used
IOException

AkentiOutputStream& operator<<(const DistinguishedName& dn)
Writes a DistinguishedName to the underlying output stream.
Throws:
IOException if writing fails
Returns:
this AkentiOutputStream for chaining
Parameters:
dn - DistinguishedName to be written
See Also:
DistinguishedName for the external format that is used
IOException

AkentiOutputStream& operator<<(const AkentiObject& obj)
Writes an AkentiObject to the underlying output stream. Calls the writeObject method on the object handing it the AkentiOutputStream.
Throws:
IOException if writing fails
Returns:
this AkentiOutputStream for chaining
Parameters:
obj - AkentiObject to be written
See Also:
AkentiObject
IOException


This class has no child classes.
Author:
Srilekha Mudumbai Abdelilah Essiari Xiang Sun
Version:
1.1 00/05/01
See Also:
AkentiInputStream

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de