Tagcoll::TextFormat< ITEM, TAG > Class Template Reference

TagcollConsumer that serializes its input to an output stream. More...

#include <TextFormat.h>

Inheritance diagram for Tagcoll::TextFormat< ITEM, TAG >:

Inheritance graph
[legend]
Collaboration diagram for Tagcoll::TextFormat< ITEM, TAG >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TextFormat (const Converter< ITEM, std::string > &itemconv, const Converter< TAG, std::string > &tagconv, FILE *out)
virtual ~TextFormat ()

Static Public Member Functions

static void outputPatch (Converter< ITEM, std::string > &itemconv, Converter< TAG, std::string > &tagconv, const PatchList< ITEM, TAG > &patch, FILE *out)
 Serialize a patch.
static void parse (Converter< std::string, ITEM > &itemconv, Converter< std::string, TAG > &tagconv, ParserInput &in, Consumer< ITEM, TAG > &consumer)
 Parse a tagged collection, sending the data to `consumer'.
static PatchList< ITEM, TAG > parsePatch (Converter< std::string, ITEM > &itemconv, Converter< std::string, TAG > &tagconv, ParserInput &in)
 Parse a tagcoll patch.

Protected Member Functions

virtual void consumeItemUntagged (const ITEM &item)
 Process an untagged item.
virtual void consumeItem (const ITEM &item, const OpSet< TAG > &tags)
 Process a tagged item, with its tags.
virtual void consumeItemsUntagged (const OpSet< ITEM > &items)
 Process a set of items, all with no tags.
virtual void consumeItems (const OpSet< ITEM > &items, const OpSet< TAG > &tags)
 Process a set of items identically tagged, with their tags.

Protected Attributes

const Converter< ITEM, std::string > & itemconv
const Converter< TAG, std::string > & tagconv
FILE * out

Detailed Description

template<class ITEM, class TAG>
class Tagcoll::TextFormat< ITEM, TAG >

TagcollConsumer that serializes its input to an output stream.

The format of the output is: lines of "comma+space"-separated items, followed by "colon+space", followed by the corresponding "comma+space"-separated tags. Examples: ITEM: ITEM: TAG ITEM: TAG1, TAG2, TAG3 ITEM1, ITEM2, ITEM3: ITEM1, ITEM2, ITEM3: TAG1, TAG2, TAG3


Constructor & Destructor Documentation

template<class ITEM, class TAG>
Tagcoll::TextFormat< ITEM, TAG >::TextFormat ( const Converter< ITEM, std::string > &  itemconv,
const Converter< TAG, std::string > &  tagconv,
FILE *  out 
) [inline]

template<class ITEM, class TAG>
virtual Tagcoll::TextFormat< ITEM, TAG >::~TextFormat (  )  [inline, virtual]


Member Function Documentation

template<class ITEM, class TAG>
void TextFormat::consumeItemUntagged ( const ITEM &  item  )  [inline, protected, virtual]

Process an untagged item.

Implements Tagcoll::Consumer< ITEM, TAG >.

template<class ITEM, class TAG>
void TextFormat::consumeItem ( const ITEM &  item,
const OpSet< TAG > &  tags 
) [inline, protected, virtual]

Process a tagged item, with its tags.

Implements Tagcoll::Consumer< ITEM, TAG >.

template<class ITEM, class TAG>
void TextFormat::consumeItemsUntagged ( const OpSet< ITEM > &  items  )  [inline, protected, virtual]

Process a set of items, all with no tags.

Reimplemented from Tagcoll::Consumer< ITEM, TAG >.

template<class ITEM, class TAG>
void TextFormat::consumeItems ( const OpSet< ITEM > &  items,
const OpSet< TAG > &  tags 
) [inline, protected, virtual]

Process a set of items identically tagged, with their tags.

Reimplemented from Tagcoll::Consumer< ITEM, TAG >.

template<class ITEM, class TAG>
void TextFormat::outputPatch ( Converter< ITEM, std::string > &  itemconv,
Converter< TAG, std::string > &  tagconv,
const PatchList< ITEM, TAG > &  patch,
FILE *  out 
) [inline, static]

Serialize a patch.

template<class ITEM, class TAG>
void TextFormat::parse ( Converter< std::string, ITEM > &  itemconv,
Converter< std::string, TAG > &  tagconv,
ParserInput in,
Consumer< ITEM, TAG > &  consumer 
) [inline, static]

Parse a tagged collection, sending the data to `consumer'.

template<class ITEM, class TAG>
PatchList< ITEM, TAG > TextFormat::parsePatch ( Converter< std::string, ITEM > &  itemconv,
Converter< std::string, TAG > &  tagconv,
ParserInput in 
) [inline, static]

Parse a tagcoll patch.


Member Data Documentation

template<class ITEM, class TAG>
const Converter<ITEM, std::string>& Tagcoll::TextFormat< ITEM, TAG >::itemconv [protected]

template<class ITEM, class TAG>
const Converter<TAG, std::string>& Tagcoll::TextFormat< ITEM, TAG >::tagconv [protected]

template<class ITEM, class TAG>
FILE* Tagcoll::TextFormat< ITEM, TAG >::out [protected]


The documentation for this class was generated from the following files:
Generated on Wed Jun 20 19:25:54 2007 for libtagcoll by  doxygen 1.5.2