#include "bruker2dicom.h"
+#include <boost/filesystem/path.hpp>
+#include <boost/filesystem/operations.hpp>
#ifndef PATH_MAX // If not defined yet : do it
#define PATH_MAX 2048
bool bigEndian = GDCM_NAME_SPACE::Util::IsCurrentProcessorBigEndian();
- if ( ! GDCM_NAME_SPACE::DirList::IsDirectory(InputDirName) )
+ //if ( ! GDCM_NAME_SPACE::DirList::IsDirectory(InputDirName) )
+ if ( ! boost::filesystem::is_directory(InputDirName) )
{
std::cout << "KO : [" << InputDirName << "] is not a Directory." << std::endl;
return 0;
it != fileNames.end();
++it)
{
- if ( GDCM_NAME_SPACE::DirList::IsDirectory(*it) )
+ if ( !boost::filesystem::is_regular(*it) ) // check twice !
+ if ( boost::filesystem::is_directory(*it) )
{
if (verbose)
std::cout << "[" << *it << "] is a directory" << std::endl;
it != fileNames.end();
++it)
{
- if ( ! GDCM_NAME_SPACE::DirList::IsDirectory(*it) )
+ if ( boost::filesystem::is_regular(*it) )
+ //if ( ! boost::filesystem::is_directory(*it) )
{
if (verbose)
std::cout << "--- [" << *it << "] is a file" << std::endl;
it != fileNames.end();
++it)
{
- if ( GDCM_NAME_SPACE::DirList::IsDirectory(*it) )
+ if ( !boost::filesystem::is_regular(*it) ) // check twice !
+ if ( boost::filesystem::is_directory(*it) )
{
// will be always "pdata" ...
if (verbose)
it != fileNames.end();
++it)
{
- if ( ! GDCM_NAME_SPACE::DirList::IsDirectory(*it) )
+ if ( !boost::filesystem::is_regular(*it) )
+ //if ( ! boost::filesystem::is_directory(*it) )
{
std::cout << "--- --- [" << *it << "] is a file" << std::endl;
}
it != fileNames.end();
++it)
{
- if ( GDCM_NAME_SPACE::DirList::IsDirectory(*it) )
+ if ( !boost::filesystem::is_regular(*it) ) // check twice !
+ if ( boost::filesystem::is_directory(*it) )
{
if (verbose)
it != fileNames.end();
++it)
{
- if ( ! GDCM_NAME_SPACE::DirList::IsDirectory(*it) )
+ if ( boost::filesystem::is_regular(*it) )
+ //if ( ! boost::filesystem::is_directory(*it) )
{
if (verbose)
std::cout << "--- [" << *it << "] is a file" << std::endl;
if (verbose)
std::cout << "Check for output directory :[" << OutputDirName << "]."
- <<std::endl;
- if ( ! GDCM_NAME_SPACE::DirList::IsDirectory(OutputDirName) ) // dirout not found
+ <<std::endl;
+ if ( ! boost::filesystem::is_directory(OutputDirName) ) // dirout not found
{
std::string strDirNameout(OutputDirName); // to please gcc 4
systemCommand = "mkdir " + strDirNameout; // create it!
if (verbose)
std::cout << systemCommand << std::endl;
system (systemCommand.c_str());
- if ( ! GDCM_NAME_SPACE::DirList::IsDirectory(OutputDirName) ) // be sure it worked
+ if ( ! boost::filesystem::is_directory(OutputDirName) ) // be sure it worked
{
if (verbose)
std::cout << "KO : not a dir : [" << OutputDirName << "] (creation failure ?)" << std::endl;