Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Core Modules
dune-common
Commits
59984754
Commit
59984754
authored
20 years ago
by
Robert Klöfkorn
Browse files
Options
Downloads
Patches
Plain Diff
Added precision for genFilename.
[[Imported from SVN: r1285]]
parent
a4221c59
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
common/misc.hh
+21
-2
21 additions, 2 deletions
common/misc.hh
with
21 additions
and
2 deletions
common/misc.hh
+
21
−
2
View file @
59984754
...
...
@@ -3,6 +3,8 @@
#ifndef __MISC_HH__
#define __MISC_HH__
#include
<iostream>
//! Check condition at compilation time
template
<
bool
flag
>
class
CompileTimeChecker
;
...
...
@@ -30,7 +32,7 @@ namespace Dune {
//********************************************************************
template
<
typename
T
>
inline
const
char
*
genFilename
(
T
*
path
,
T
*
fn
,
int
ntime
)
inline
const
char
*
genFilename
(
T
*
path
,
T
*
fn
,
int
ntime
,
int
precision
=
6
)
{
static
char
name
[
256
];
char
*
cp
;
...
...
@@ -53,7 +55,24 @@ namespace Dune {
cp
=
name
;
while
(
*
cp
)
cp
++
;
sprintf
(
cp
,
"%010d"
,
ntime
);
switch
(
precision
)
{
case
2
:
{
sprintf
(
cp
,
"%02d"
,
ntime
);
break
;
}
case
3
:
{
sprintf
(
cp
,
"%03d"
,
ntime
);
break
;
}
case
4
:
{
sprintf
(
cp
,
"%04d"
,
ntime
);
break
;
}
case
5
:
{
sprintf
(
cp
,
"%05d"
,
ntime
);
break
;
}
case
6
:
{
sprintf
(
cp
,
"%06d"
,
ntime
);
break
;
}
case
7
:
{
sprintf
(
cp
,
"%07d"
,
ntime
);
break
;
}
case
8
:
{
sprintf
(
cp
,
"%08d"
,
ntime
);
break
;
}
case
9
:
{
sprintf
(
cp
,
"%09d"
,
ntime
);
break
;
}
case
10
:
{
sprintf
(
cp
,
"%010d"
,
ntime
);
break
;
}
default
:
{
std
::
cerr
<<
"Couldn't gernerate filename with precision = "
<<
precision
<<
", file = "
<<
__FILE__
<<
", line = "
<<
__LINE__
<<
"
\n
"
;
abort
();
}
}
return
(
(
T
*
)
name
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment