Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Backofen, Rainer
amdis
Commits
cce80ff0
Commit
cce80ff0
authored
Jun 03, 2011
by
Praetorius, Simon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initfile parser - small changes
parent
00561533
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
4 deletions
+12
-4
AMDiS/src/Initfile.cc
AMDiS/src/Initfile.cc
+4
-0
AMDiS/src/Initfile.h
AMDiS/src/Initfile.h
+8
-4
No files found.
AMDiS/src/Initfile.cc
View file @
cce80ff0
...
...
@@ -6,6 +6,8 @@
#include <sstream>
using
namespace
std
;
namespace
AMDiS
{
/// the small parser for the initfile. see description of read(Initfile&, istream&)
struct
Parser
{
Parser
(
const
string
&
line
)
{
...
...
@@ -140,3 +142,5 @@ void Initfile::write(std::string fn) {
write
(
outFile
);
};
}
AMDiS/src/Initfile.h
View file @
cce80ff0
...
...
@@ -16,9 +16,11 @@
#include <boost/algorithm/string/trim.hpp>
#include <boost/lexical_cast.hpp>
using
namespace
AMDiS
;
namespace
InitfileInternal
{
namespace
AMDiS
{
namespace
InitfileInternal
{
/// Exceptions
struct
WrongVectorSize
:
std
::
runtime_error
{
WrongVectorSize
(
std
::
string
m
)
:
std
::
runtime_error
(
m
)
{}
...
...
@@ -50,7 +52,7 @@ namespace InitfileInternal {
return
swap
;
}
/// return the delimiter or throw an exception if there is no known delimiter in value
size_t
checkDelim
(
const
std
::
string
&
value
,
const
std
::
string
&
delims
)
{
inline
size_t
checkDelim
(
const
std
::
string
&
value
,
const
std
::
string
&
delims
)
{
size_t
pos
(
std
::
string
::
npos
);
for
(
unsigned
i
=
0
;
i
<
delims
.
length
();
++
i
)
{
pos
=
value
.
find
(
delims
[
i
]);
...
...
@@ -164,7 +166,7 @@ namespace InitfileInternal {
temp_vec
[
i
]
=
c
[
i
];
convert
(
temp_vec
,
valStr
);
}
}
// end namespace InitfileInternal
}
// end namespace InitfileInternal
/** The entry in an initfile. This helper class was constructed to allow calls like
* val = data.get(tag)
...
...
@@ -375,4 +377,6 @@ protected:
int
msgInfo
,
msgWait
,
paramInfo
;
};
}
// end namespace AMDiS
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment