Пример #1
0
void OutputVisitor::s_put(const tRational<LINTEGER> & x,Sink & si) {
   if(x.denominator().zero()) {
    si << x.numerator().internal();
  } else {
    Sink sink(si.outputFunction("Divide",2L));
    sink << x.numerator().internal() << x.denominator().internal();
  };    
};
Пример #2
0
void _GetAllCommands(Source & so,Sink & si) {
  so.shouldBeEnd();
  list<simpleString> L;
  getAllCommands(L);
  long sz  = L.size();
  Sink sink(si.outputFunction("List",sz));
  GBStream << "Begin loop\n";
  list<simpleString>::const_iterator w = L.begin();
  for(long i=1L;i<=sz;++i,++w) {
    sink.putString((*w).chars());
  };
  GBStream << "Done with " << sz << "elements!\n";
};
Пример #3
0
void Field::put(Sink & sink1) const {
  Sink sink2(sink1.outputFunction("List",2L));
  sink1 << numerator().asInt() << denominator().asInt();
};