WSL/SLF GitLab Repository
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
snow-models
meteoio
Commits
27134eba
Commit
27134eba
authored
Apr 26, 2016
by
Mathias Bavay
Browse files
Improving a few error messages...
parent
2d99fade
Changes
1
Hide whitespace changes
Inline
Side-by-side
meteoio/plugins/libsmet.cc
View file @
27134eba
...
...
@@ -696,7 +696,7 @@ SMETReader::SMETReader(const std::string& in_fname)
{
std
::
ifstream
fin
;
//Input file streams
fin
.
clear
();
if
(
!
SMETCommon
::
fileExists
(
filename
))
throw
SMETException
(
filename
,
AT
);
//prevent invalid filenames
if
(
!
SMETCommon
::
fileExists
(
filename
))
throw
SMETException
(
"File '"
+
filename
+
"' does not exists"
,
AT
);
//prevent invalid filenames
errno
=
0
;
fin
.
open
(
filename
.
c_str
(),
ios
::
in
|
ios
::
binary
);
//ascii does end of line translation, which messes up the pointer code
if
(
fin
.
fail
())
{
...
...
@@ -1003,7 +1003,7 @@ void SMETReader::read(std::vector<std::string>& vec_timestamp, std::vector<doubl
ifstream
fin
;
fin
.
clear
();
if
(
!
SMETCommon
::
fileExists
(
filename
))
throw
SMETException
(
filename
,
AT
);
//prevent invalid filenames
if
(
!
SMETCommon
::
fileExists
(
filename
))
throw
SMETException
(
"File '"
+
filename
+
"' does not exists"
,
AT
);
//prevent invalid filenames
errno
=
0
;
fin
.
open
(
filename
.
c_str
(),
ios
::
in
|
ios
::
binary
);
//ascii mode messes up pointer code on windows (automatic eol translation)
if
(
fin
.
fail
())
{
...
...
@@ -1054,7 +1054,7 @@ void SMETReader::read(std::vector<double>& vec_data)
ios_base
::
openmode
mode
=
ios
::
in
|
ios
::
binary
;
//read as binary to avoid eol mess
ifstream
fin
;
if
(
!
SMETCommon
::
fileExists
(
filename
))
throw
SMETException
(
filename
,
AT
);
//prevent invalid filenames
if
(
!
SMETCommon
::
fileExists
(
filename
))
throw
SMETException
(
"File '"
+
filename
+
"' does not exists"
,
AT
);
//prevent invalid filenames
errno
=
0
;
fin
.
open
(
filename
.
c_str
(),
mode
);
if
(
fin
.
fail
())
{
...
...
Write
Preview
Supports
Markdown
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