class AkentiOutputStream |
An AkentiOutputStream object is used to serialize all types of objects using a simple scheme to write the objects' string reprsentations.
![]() | AkentiOutputStream (ostream& os) Constructs this object given an ostream object specified by os. |
![]() | write (const char* ptr, int n) |
![]() | operator<< (char c) Writes a char to the underlying output stream. |
![]() | operator<< (int n) Writes an int to the underlying output stream. |
![]() | operator<< (bool b) Writes a bool to the underlying output stream. |
![]() | operator<< (long l) Writes a long to the underlying output stream. |
![]() | operator<< (double d) Writes a double to the underlying output stream. |
![]() | operator<< (const string& s) Writes a string to the underlying output stream. |
![]() | operator<< (const UtcTime& time) Writes a UtcTime to the underlying output stream. |
![]() | operator<< (const URL& url) Writes a URL to the underlying output stream. |
![]() | operator<< (const DistinguishedName& dn) Writes a DistinguishedName to the underlying output stream. |
![]() | operator<< (const AkentiObject& obj) Writes an AkentiObject to the underlying output stream. |
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.
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"
Alphabetic index HTML hierarchy of classes or Java