Changeset 163:c82fd9568d75 in lemon-1.0 for lemon/lgf_writer.h
- Timestamp:
- 05/31/08 12:31:21 (16 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/lgf_writer.h
r156 r163 196 196 default: 197 197 if (c < 0x20) { 198 std::ios::fmtflags flags = os.flags(); 198 199 os << '\\' << std::oct << static_cast<int>(c); 200 os.flags(flags); 199 201 } else { 200 202 os << c; … … 244 246 /// member function. A map writing rule can be added to the writer 245 247 /// with the \c nodeMap() or \c arcMap() members. An optional 246 /// converter parameter can also be added as a standard functor converting from247 /// the value type of the map to std::string. If it is set, it will248 /// determine how the map's value type is written to the output249 /// stream. If the functor is not set, then a default conversion250 /// will be used. The \c attribute(), \c node() and \c arc() functions251 /// ar e used to add attribute writing rules.248 /// converter parameter can also be added as a standard functor 249 /// converting from the value type of the map to std::string. If it 250 /// is set, it will determine how the map's value type is written to 251 /// the output stream. If the functor is not set, then a default 252 /// conversion will be used. The \c attribute(), \c node() and \c 253 /// arc() functions are used to add attribute writing rules. 252 254 /// 253 255 ///\code … … 270 272 /// 271 273 /// The \c skipNodes() and \c skipArcs() functions forbid the 272 /// writing of the sections. If two arc sections should be written to the273 /// output, it can be done in two passes, the first pass writes the274 /// node section and the first arc section, then the second pass275 /// s kips the node section and writes just the arc section to the276 /// s tream. The output stream can be retrieved with the \c ostream()277 /// function, hence the second pass can append its output to the output of the278 /// first pass.274 /// writing of the sections. If two arc sections should be written 275 /// to the output, it can be done in two passes, the first pass 276 /// writes the node section and the first arc section, then the 277 /// second pass skips the node section and writes just the arc 278 /// section to the stream. The output stream can be retrieved with 279 /// the \c ostream() function, hence the second pass can append its 280 /// output to the output of the first pass. 279 281 template <typename _Digraph> 280 282 class DigraphWriter { … … 350 352 _skip_nodes(other._skip_nodes), _skip_arcs(other._skip_arcs) { 351 353 352 other. is = 0;354 other._os = 0; 353 355 other.local_os = false; 354 356 … … 718 720 /// \relates DigraphWriter 719 721 template <typename Digraph> 720 DigraphWriter<Digraph> digraphWriter(std::istream& is, Digraph& digraph) { 721 return DigraphWriter<Digraph>(is, digraph); 722 DigraphWriter<Digraph> digraphWriter(std::ostream& os, Digraph& digraph) { 723 DigraphWriter<Digraph> tmp(os, digraph); 724 return tmp; 722 725 } 723 726 … … 726 729 DigraphWriter<Digraph> digraphWriter(const std::string& fn, 727 730 Digraph& digraph) { 728 return DigraphWriter<Digraph>(fn, digraph); 731 DigraphWriter<Digraph> tmp(fn, digraph); 732 return tmp; 729 733 } 730 734 … … 732 736 template <typename Digraph> 733 737 DigraphWriter<Digraph> digraphWriter(const char* fn, Digraph& digraph) { 734 return DigraphWriter<Digraph>(fn, digraph); 738 DigraphWriter<Digraph> tmp(fn, digraph); 739 return tmp; 735 740 } 736 741 }
Note: See TracChangeset
for help on using the changeset viewer.