Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages   Examples  

CTBrange.cxx

Go to the documentation of this file.
00001 
00006 /*----------------------------------------------------------------------------*/
00007 /* C Tool Box: Designed and implemented by:                                   */
00008 /*    Walter F.J. Mueller   Gesellschaft fuer Schwerionenforschung (GSI)      */
00009 /*                          Postfach 110552, D-64220 Darmstadt, Germany       */
00010 /*                  Email:  W.F.J.Mueller@gsi.de                              */
00011 /*                  WWW:    http://www-kp3.gsi.de/www/kp3/people/mueller.html */
00012 /*------------------------------------------+---------------------------------*/
00013 
00014 #include "CTB.hxx"
00015 #include "CTBrange.hxx"
00016 
00022 //------------------------------------------+-----------------------------------
00024 
00025 void CTBrange::ToStream(ostream& os) const
00026 {
00027   os << mi_begin << ":" << mi_end;
00028   return;
00029 }
00030 
00031 //------------------------------------------+-----------------------------------
00033 
00037 void CTBrange::FromStream(istream& is)
00038 {
00039   if (!is) return;                          // quit if stream not good
00040 
00041   is >> mi_begin;                           // read begin
00042 
00043   if (!is || is.peek() != ':') {            // quit if stream bad or no ':'
00044     mi_end    = mi_begin;
00045     return;
00046   }
00047   
00048   is.get();                                 // if ':', read end
00049   is >> mi_end;
00050 
00051   return;
00052 }
00053 
00054 #if (defined(CTB__OutLine) || defined(CTBrange__OutLine))
00055 #define inline
00056 #include "CTBrange.icc"
00057 #undef  inline
00058 #endif

Generated at Fri Oct 24 18:11:29 2003 for CTBbase by doxygen1.2.9-20010812 written by Dimitri van Heesch, © 1997-2001