pieceStandIO.cc
Go to the documentation of this file.
00001 /* pieceStandIO.cc
00002  */
00003 #include "osl/pieceStandIO.h"
00004 #include "osl/pieceStand.h"
00005 #include <boost/foreach.hpp>
00006 #include <iostream>
00007 
00008 std::ostream& osl::
00009 PieceStandIO::writeNumbers(std::ostream& os, const PieceStand& stand)
00010 {
00011   BOOST_FOREACH(Ptype ptype, PieceStand::order) {
00012     os << stand.get(ptype) << " ";
00013   }
00014   return os;
00015 }
00016 std::istream& osl::
00017 PieceStandIO::readNumbers(std::istream& is, PieceStand& stand)
00018 {
00019   stand  = PieceStand();
00020   BOOST_FOREACH(Ptype ptype, PieceStand::order) {
00021     int val;
00022     if (is >> val) 
00023       stand.add(ptype, val);
00024   }
00025   return is;
00026 }
00027 
00028 /* ------------------------------------------------------------------------- */
00029 // ;;; Local Variables:
00030 // ;;; mode:c++
00031 // ;;; c-basic-offset:2
00032 // ;;; End:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines