# Changeset 163:c82fd9568d75 in lemon-1.0 for lemon/lgf_writer.h

Ignore:
Timestamp:
05/31/08 12:31:21 (13 years ago)
Branch:
default
Phase:
public
Message:

Bug fixes and improvements in LGF IO

File:
1 edited

Unmodified
Added
Removed
• ## lemon/lgf_writer.h

 r156 default: if (c < 0x20) { std::ios::fmtflags flags = os.flags(); os << '\\' << std::oct << static_cast(c); os.flags(flags); } else { os << c; /// member function. A map writing rule can be added to the writer /// with the \c nodeMap() or \c arcMap() members. An optional /// converter parameter can also be added as a standard functor converting from /// the value type of the map to std::string. If it is set, it will /// determine how the map's value type is written to the output /// stream. If the functor is not set, then a default conversion /// will be used. The \c attribute(), \c node() and \c arc() functions /// are used to add attribute writing rules. /// converter parameter can also be added as a standard functor /// converting from the value type of the map to std::string. If it /// is set, it will determine how the map's value type is written to /// the output stream. If the functor is not set, then a default /// conversion will be used. The \c attribute(), \c node() and \c /// arc() functions are used to add attribute writing rules. /// ///\code /// /// The \c skipNodes() and \c skipArcs() functions forbid the /// writing of the sections. If two arc sections should be written to the /// output, it can be done in two passes, the first pass writes the /// node section and the first arc section, then the second pass /// skips the node section and writes just the arc section to the /// stream. The output stream can be retrieved with the \c ostream() /// function, hence the second pass can append its output to the output of the /// first pass. /// writing of the sections. If two arc sections should be written /// to the output, it can be done in two passes, the first pass /// writes the node section and the first arc section, then the /// second pass skips the node section and writes just the arc /// section to the stream. The output stream can be retrieved with /// the \c ostream() function, hence the second pass can append its /// output to the output of the first pass. template class DigraphWriter { _skip_nodes(other._skip_nodes), _skip_arcs(other._skip_arcs) { other.is = 0; other._os = 0; other.local_os = false; /// \relates DigraphWriter template DigraphWriter digraphWriter(std::istream& is, Digraph& digraph) { return DigraphWriter(is, digraph); DigraphWriter digraphWriter(std::ostream& os, Digraph& digraph) { DigraphWriter tmp(os, digraph); return tmp; } DigraphWriter digraphWriter(const std::string& fn, Digraph& digraph) { return DigraphWriter(fn, digraph); DigraphWriter tmp(fn, digraph); return tmp; } template DigraphWriter digraphWriter(const char* fn, Digraph& digraph) { return DigraphWriter(fn, digraph); DigraphWriter tmp(fn, digraph); return tmp; } }
Note: See TracChangeset for help on using the changeset viewer.