Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BornAgain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container 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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mlz
BornAgain
Commits
beb74c78
Commit
beb74c78
authored
5 years ago
by
Pospelov, Gennady
Browse files
Options
Downloads
Patches
Plain Diff
Provide possibility to write GUI projects to directories containing non-ascii chars.
parent
a8069699
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Core/InputOutput/OutputDataReader.cpp
+7
-1
7 additions, 1 deletion
Core/InputOutput/OutputDataReader.cpp
Core/InputOutput/OutputDataWriter.cpp
+7
-1
7 additions, 1 deletion
Core/InputOutput/OutputDataWriter.cpp
with
14 additions
and
2 deletions
Core/InputOutput/OutputDataReader.cpp
+
7
−
1
View file @
beb74c78
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
#include
"boost_streams.h"
#include
"boost_streams.h"
#endif
#endif
#include
<fstream>
#include
<fstream>
#include
"FileSystemUtils.h"
OutputDataReader
::
OutputDataReader
(
const
std
::
string
&
file_name
)
OutputDataReader
::
OutputDataReader
(
const
std
::
string
&
file_name
)
:
m_file_name
(
file_name
)
:
m_file_name
(
file_name
)
...
@@ -41,7 +42,12 @@ OutputData<double>* OutputDataReader::getOutputData()
...
@@ -41,7 +42,12 @@ OutputData<double>* OutputDataReader::getOutputData()
if
(
isTiffFile
(
m_file_name
)
||
isCompressed
(
m_file_name
))
if
(
isTiffFile
(
m_file_name
)
||
isCompressed
(
m_file_name
))
openmode
=
std
::
ios
::
in
|
std
::
ios_base
::
binary
;
openmode
=
std
::
ios
::
in
|
std
::
ios_base
::
binary
;
fin
.
open
(
m_file_name
.
c_str
(),
openmode
);
#ifdef _WIN32
fin
.
open
(
FileSystemUtils
::
convert_utf8_to_utf16
(
m_file_name
),
openmode
);
#else
fin
.
open
(
m_file_name
,
openmode
);
#endif
if
(
!
fin
.
is_open
())
if
(
!
fin
.
is_open
())
throw
Exceptions
::
FileNotIsOpenException
(
throw
Exceptions
::
FileNotIsOpenException
(
"OutputDataReader::getOutputData() -> Error. Can't open file '"
"OutputDataReader::getOutputData() -> Error. Can't open file '"
...
...
This diff is collapsed.
Click to expand it.
Core/InputOutput/OutputDataWriter.cpp
+
7
−
1
View file @
beb74c78
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
#include
"boost_streams.h"
#include
"boost_streams.h"
#endif
#endif
#include
<fstream>
#include
<fstream>
#include
"FileSystemUtils.h"
OutputDataWriter
::
OutputDataWriter
(
const
std
::
string
&
file_name
)
OutputDataWriter
::
OutputDataWriter
(
const
std
::
string
&
file_name
)
:
m_file_name
(
file_name
)
:
m_file_name
(
file_name
)
...
@@ -36,13 +37,18 @@ void OutputDataWriter::writeOutputData(const OutputData<double>& data)
...
@@ -36,13 +37,18 @@ void OutputDataWriter::writeOutputData(const OutputData<double>& data)
if
(
!
m_write_strategy
)
if
(
!
m_write_strategy
)
throw
Exceptions
::
NullPointerException
(
"OutputDataWriter::getOutputData() ->"
throw
Exceptions
::
NullPointerException
(
"OutputDataWriter::getOutputData() ->"
" Error! No read strategy defined"
);
" Error! No read strategy defined"
);
std
::
ofstream
fout
;
std
::
ofstream
fout
;
std
::
ios_base
::
openmode
openmode
=
std
::
ios
::
out
;
std
::
ios_base
::
openmode
openmode
=
std
::
ios
::
out
;
if
(
isTiffFile
(
m_file_name
)
||
isCompressed
(
m_file_name
))
if
(
isTiffFile
(
m_file_name
)
||
isCompressed
(
m_file_name
))
openmode
=
std
::
ios
::
out
|
std
::
ios_base
::
binary
;
openmode
=
std
::
ios
::
out
|
std
::
ios_base
::
binary
;
#ifdef _WIN32
fout
.
open
(
FileSystemUtils
::
convert_utf8_to_utf16
(
m_file_name
),
openmode
);
#else
fout
.
open
(
m_file_name
,
openmode
);
#endif
fout
.
open
(
m_file_name
.
c_str
(),
openmode
);
if
(
!
fout
.
is_open
())
if
(
!
fout
.
is_open
())
throw
Exceptions
::
FileNotIsOpenException
(
"OutputDataWriter::writeOutputData() -> Error. "
throw
Exceptions
::
FileNotIsOpenException
(
"OutputDataWriter::writeOutputData() -> Error. "
"Can't open file '"
+
m_file_name
+
"' for writing."
);
"Can't open file '"
+
m_file_name
+
"' for writing."
);
...
...
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