numstreams.h

00001 /*************************************************************************************
00002  * MechSys - A C++ library to simulate (Continuum) Mechanical Systems                *
00003  * Copyright (C) 2005 Dorival de Moraes Pedroso <dorival.pedroso at gmail.com>       *
00004  * Copyright (C) 2005 Raul Dario Durand Farfan  <raul.durand at gmail.com>           *
00005  *                                                                                   *
00006  * This file is part of MechSys.                                                     *
00007  *                                                                                   *
00008  * MechSys is free software; you can redistribute it and/or modify it under the      *
00009  * terms of the GNU General Public License as published by the Free Software         *
00010  * Foundation; either version 2 of the License, or (at your option) any later        *
00011  * version.                                                                          *
00012  *                                                                                   *
00013  * MechSys is distributed in the hope that it will be useful, but WITHOUT ANY        *
00014  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A   *
00015  * PARTICULAR PURPOSE. See the GNU General Public License for more details.          *
00016  *                                                                                   *
00017  * You should have received a copy of the GNU General Public License along with      *
00018  * MechSys; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, *
00019  * Fifth Floor, Boston, MA 02110-1301, USA                                           *
00020  *************************************************************************************/
00021 
00022 #ifndef MECHSYS_NUMSTREAMS_H
00023 #define MECHSYS_NUMSTREAMS_H
00024 
00025 #include <iostream>
00026 #include <iomanip>
00027 
00028 namespace Util
00029 {
00030 
00031 class _4 {};
00032 std::ostream & operator<< (std::ostream & os, _4 const & dummy)
00033 { os<<" "<<std::setw(4); return os; }
00034 
00035 class _6 {};
00036 std::ostream & operator<< (std::ostream & os, _6 const & dummy)
00037 { os<<" "<<std::setw(6); return os; }
00038 
00039 class _6_3 {};
00040 std::ostream & operator<< (std::ostream & os, _6_3 const & dummy)
00041 { os<<" "<<std::setw(7)<<std::fixed<<std::setprecision(3); return os; } // add 1 (for sign)
00042 
00043 class _12_6 {};
00044 std::ostream & operator<< (std::ostream & os, _12_6 const & dummy)
00045 { os<<" "<<std::setw(13)<<std::fixed<<std::setprecision(6); return os; } // add 1 (for sign)
00046 
00047 class _3s {};
00048 std::ostream & operator<< (std::ostream & os, _3s const & dummy)
00049 { os<<" "<<std::setw(12)<<std::scientific<<std::setprecision(3); return os; } // add 9
00050 
00051 class _8s {};
00052 std::ostream & operator<< (std::ostream & os, _8s const & dummy)
00053 { os<<" "<<std::setw(17)<<std::scientific<<std::setprecision(8); return os; } // add 9
00054 
00055 class _a {};
00056 std::ostream & operator<< (std::ostream & os, _a const & dummy)
00057 { os<<" "<<std::boolalpha; return os; }
00058 
00059 }; // namespace Util
00060 
00061 #endif // MECHSYS_NUMSTREAMS_H

Generated on Wed Jan 24 15:56:27 2007 for MechSys by  doxygen 1.4.7