All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
pieceStandIO.cc
Go to the documentation of this file.
1 /* pieceStandIO.cc
2  */
3 #include "osl/pieceStandIO.h"
4 #include "osl/pieceStand.h"
5 #include <boost/foreach.hpp>
6 #include <iostream>
7 
8 std::ostream& osl::
9 PieceStandIO::writeNumbers(std::ostream& os, const PieceStand& stand)
10 {
11  BOOST_FOREACH(Ptype ptype, PieceStand::order) {
12  os << stand.get(ptype) << " ";
13  }
14  return os;
15 }
16 std::istream& osl::
17 PieceStandIO::readNumbers(std::istream& is, PieceStand& stand)
18 {
19  stand = PieceStand();
20  BOOST_FOREACH(Ptype ptype, PieceStand::order) {
21  int val;
22  if (is >> val)
23  stand.add(ptype, val);
24  }
25  return is;
26 }
27 
28 /* ------------------------------------------------------------------------- */
29 // ;;; Local Variables:
30 // ;;; mode:c++
31 // ;;; c-basic-offset:2
32 // ;;; End: