Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenWalnut
OpenWalnut Core
Commits
b3283560
Commit
b3283560
authored
Sep 17, 2009
by
Mathias Goldau
Browse files
[CHANGE] I think its better to rely on boost filesystem then the ordinary find method.
parent
2e57dfb6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
10 deletions
+8
-10
src/CMakeLists.txt
src/CMakeLists.txt
+1
-1
src/dataHandler/WLoaderManager.cpp
src/dataHandler/WLoaderManager.cpp
+7
-9
No files found.
src/CMakeLists.txt
View file @
b3283560
...
...
@@ -30,7 +30,7 @@ ENDIF( CMAKE_BUILD_TYPE STREQUAL "Static" )
# To see which boost libs we currently use, you may run the following command
# in the trunk/src directory on a linux box to make some investigations:
# grep -i include `find . -type f` | grep boost | awk '{print $2}' | sort | uniq
FIND_PACKAGE
(
Boost REQUIRED program_options thread
)
FIND_PACKAGE
(
Boost REQUIRED program_options thread
filesystem
)
ASSERT_GE_VERSION
(
"Boost"
"
${
Boost_MAJOR_VERSION
}
.
${
Boost_MINOR_VERSION
}
.
${
Boost_SUBMINOR_VERSION
}
"
1.36.0
)
INCLUDE_DIRECTORIES
(
${
Boost_INCLUDE_DIR
}
)
...
...
src/dataHandler/WLoaderManager.cpp
View file @
b3283560
...
...
@@ -24,6 +24,7 @@
#include <iostream>
#include <string>
#include <boost/thread.hpp>
#include <boost/filesystem.hpp>
#include "WLoaderManager.h"
#include "WDataSet.h"
...
...
@@ -33,33 +34,30 @@
std
::
string
getSuffix
(
std
::
string
name
)
{
size_t
position
=
name
.
find_last_of
(
'.'
);
if
(
position
==
std
::
string
::
npos
)
return
""
;
else
return
name
.
substr
(
position
+
1
);
boost
::
filesystem
::
path
p
(
name
);
return
p
.
extension
();
}
void
WLoaderManager
::
load
(
std
::
string
fileName
,
boost
::
shared_ptr
<
WDataHandler
>
dataHandler
)
{
std
::
string
suffix
=
getSuffix
(
fileName
);
if
(
suffix
==
"nii"
||
suffix
==
"gz"
)
if
(
suffix
==
"
.
nii"
||
suffix
==
"
.
gz"
)
{
WLoaderNIfTI
niiLoader
(
fileName
,
dataHandler
);
boost
::
thread
loaderThread
(
niiLoader
);
}
else
if
(
suffix
==
"edf"
)
else
if
(
suffix
==
"
.
edf"
)
{
WLoaderBiosig
biosigLoader
(
fileName
,
dataHandler
);
boost
::
thread
loaderThread
(
biosigLoader
);
}
else
if
(
suffix
==
"asc"
)
else
if
(
suffix
==
"
.
asc"
)
{
WLoaderEEGASCII
eegAsciiLoader
(
fileName
,
dataHandler
);
boost
::
thread
loaderThread
(
eegAsciiLoader
);
}
else
if
(
suffix
==
"vtk"
)
else
if
(
suffix
==
"
.
vtk"
)
{
// This is a dummy implementation.
// You need to provide a real implementation here if you want to load vtk.
...
...
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