DUNE PDELab (2.8)

instationaryfilenamehelper.hh
1// -*- tab-width: 2; indent-tabs-mode: nil -*-
2// vi: set et ts=2 sw=2 sts=2:
3
4#ifndef DUNE_PDELAB_COMMON_INSTATIONARYFILENAMEHELPER_HH
5#define DUNE_PDELAB_COMMON_INSTATIONARYFILENAMEHELPER_HH
6
7#include <iostream>
8
9namespace Dune {
10 namespace PDELab {
11
16 class FilenameHelper
17 {
18 public:
19 FilenameHelper(const char *basename_, int i_=0)
20 : i(i_)
21 {
22 sprintf(basename,"%s",basename_);
23 }
24
25 FilenameHelper(const std::string & basename_, int i_=0)
26 : i(i_)
27 {
28 sprintf(basename,"%s",basename_.c_str());
29 }
30
31 const char *getName (int i_)
32 {
33 sprintf(fname,"%s-%05d",basename,i_);
34 return fname;
35 }
36
37 const char *getName ()
38 {
39 sprintf(fname,"%s-%05d",basename,i);
40 return fname;
41 }
42
43 void increment ()
44 {
45 i++;
46 }
47
48 private:
49 char fname[255];
50 char basename[255];
51 int i;
52 }; // end class FilenameHelper
53
55 } // end namespace PDELab
56} // end namespace Dune
57#endif // DUNE_PDELAB_COMMON_INSTATIONARYFILENAMEHELPER_HH
Dune namespace.
Definition: alignedallocator.hh:11
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Dec 22, 23:30, 2024)