Logo  0.95.0-final
Finite Element Embedded Library and Language in C++
Feel++ Feel++ on Github Feel++ community
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
adfstream.hpp
Go to the documentation of this file.
1 /* -*- mode: c++; coding: utf-8; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; show-trailing-whitespace: t -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2 
3  This file is part of the Feel library
4 
5  Author(s): Christophe Prud'homme <christophe.prudhomme@feelpp.org>
6  Date: 2011-02-14
7 
8  Copyright (C) 2011 Université Joseph Fourier (Grenoble I)
9 
10  This library is free software; you can redistribute it and/or
11  modify it under the terms of the GNU Lesser General Public
12  License as published by the Free Software Foundation; either
13  version 3.0 of the License, or (at your option) any later version.
14 
15  This library is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  Lesser General Public License for more details.
19 
20  You should have received a copy of the GNU Lesser General Public
21  License along with this library; if not, write to the Free Software
22  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 */
30 #include <fstream>
31 #include <iomanip>
32 #include <iostream>
33 
34 namespace Feel
35 {
36 class ADOfstream
37  :
38 public std::ofstream
39 {
40 
41 public:
42 
43  ADOfstream( const char* filename,
44  const char* description,
45  const char* sourceFile,
46  const char* mnemonic )
47  :
48  std::ofstream( filename )
49  {
50  ( *this ) <<
51  "/* \n"
52  " " << filename << "\t" << description << std::endl <<
53  " This file is part of gstlibs.\n"
54  "\n"
55  " Copyright (C) 2011 Christophe Prud'homme\n"
56  "\n"
57  " gstlibs is free software; you can redistribute it and/or modify\n"
58  " it under the terms of the GNU Lesser General Public License as published by\n"
59  " the Free Software Foundation; either version 2 of the License, or\n"
60  " (at your option) any later version.\n"
61  " \n"
62  " gstlibs is distributed in the hope that it will be useful,\n"
63  " but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
64  " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
65  " GNU Lesser General Public License for more details.\n"
66  " \n"
67  " You should have received a copy of the GNU Lesser General Public License\n"
68  " along with gstlibs; if not, write to the Free Software\n"
69  " Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n"
70  "*/"
71  << std::endl << std::endl
72  << "// Generated source file. Do not edit. " << std::endl
73  << "// " << sourceFile << " " << __DATE__ << " " << __TIME__
74  << std::endl << std::endl
75  << "#ifndef " << mnemonic << std::endl
76  << "#define " << mnemonic << std::endl << std::endl;
77  }
78 
79  void include( const char* filename )
80  {
81  ( *this ) << "#include <" << filename << ">" << std::endl;
82  }
83 
84  void beginNamespace( std::string const& __ns )
85  {
86  ( *this ) << "namespace " << __ns << "\n"
87  << "{\n";
88  //(*this) << "BZ_NAMESPACE(blitz)" << std::endl << std::endl;
89  }
90  void endNamespace()
91  {
92  ( *this ) << "}\n";
93  }
94  ~ADOfstream()
95  {
96  ( *this ) << std::endl << "#endif" << std::endl;
97 
98  }
99 
100 };
101 
102 }
103 

Generated on Fri Oct 25 2013 14:24:03 for Feel++ by doxygen 1.8.4