feisty meow concerns codebase  2.140
basis::text_streamable Class Referenceabstract

a base for classes that can stream their contents out to a textual form. More...

#include <contracts.h>

Inheritance diagram for basis::text_streamable:
Collaboration diagram for basis::text_streamable:

Public Member Functions

virtual bool produce (base_string &target) const =0
 sends the derived class's member data into the "target" in a reversible manner. More...
 
virtual bool consume (const base_string &source)=0
 chows down on a string that supposedly contains a streamed form. More...
 
- Public Member Functions inherited from basis::nameable
virtual const char * class_name () const =0
 Returns the bare name of this class as a constant character pointer. More...
 

Detailed Description

a base for classes that can stream their contents out to a textual form.

Definition at line 170 of file contracts.h.

Member Function Documentation

◆ consume()

virtual bool basis::text_streamable::consume ( const base_string source)
pure virtual

chows down on a string that supposedly contains a streamed form.

the derived class must know how to eat just the portion of the string that holds its data type and no more.

◆ produce()

virtual bool basis::text_streamable::produce ( base_string target) const
pure virtual

sends the derived class's member data into the "target" in a reversible manner.

this should use a tagging system of some sort so that not only can the derived class verify that its type is really right there in the string, but also that it gets all of its class data and no other data. the "target" will be destructively consumed, and after a successful call will no longer contain the object's streamed form at its head.


The documentation for this class was generated from the following file: