Item API needs operator<<

Bug #907070 reported by Paul J. Lucas
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zorba
New
Low
Paul J. Lucas

Bug Description

To emit the string value of an Item to an ostream, you currently have to use getStringValue() or getStringValue2(). This is inefficient since a string that is otherwise not needed needs to be created.

Instead, there should be a global operator<< defined:

    std::ostream& operator<<( std::ostream&, store::Item const& );

Its implementation could simply call a new protected, pure virtual member function for Item:

    virtual void emit( std::ostream& ) const = 0;

Tags: store
Changed in zorba:
milestone: none → 2.2
Revision history for this message
Matthias Brantner (matthias-brantner) wrote :

I like the suggestion. However, the function should probably be called emitStringValue in order to make it clear what the exact semantics is.

Changed in zorba:
assignee: Matthias Brantner (matthias-brantner) → Paul J. Lucas (paul-lucas)
Changed in zorba:
importance: Undecided → Low
Changed in zorba:
status: New → In Progress
Changed in zorba:
milestone: 2.2 → 2.5
Changed in zorba:
milestone: 2.5 → none
Changed in zorba:
status: In Progress → New
Chris Hillery (ceejatec)
tags: removed: item
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.