modifications for boost filesystem
# For boost 1.46 troubles... // JPR.
# For boost 1.46 troubles... // JPR.
-add_definitions(-DBOOST_FILESYSTEM_VERSION=2)
+add_definitions(-DBOOST_FILESYSTEM_VERSION=3)
if ( i->first == "D0004_1500" )
{
boost::filesystem::path full_path(filename);
if ( i->first == "D0004_1500" )
{
boost::filesystem::path full_path(filename);
- std::string f = full_path.leaf();
+ std::string f = full_path.leaf().string();
i->second = f;
}
else if ( i->first == "FullFileName" )
i->second = f;
}
else if ( i->first == "FullFileName" )
if ( i->first == "D0004_1500" )
{
boost::filesystem::path full_path(filename);
if ( i->first == "D0004_1500" )
{
boost::filesystem::path full_path(filename);
- std::string f = full_path.leaf();
+ std::string f = full_path.leaf().string();
i->second = f;
}
else if ( i->first == "FullFileName" )
i->second = f;
}
else if ( i->first == "FullFileName" )
if ( attr.find("D0004_1500") != attr.end())
{
boost::filesystem::path full_path(filename);
if ( attr.find("D0004_1500") != attr.end())
{
boost::filesystem::path full_path(filename);
- std::string f = full_path.leaf();
+ std::string f = full_path.leaf().string();
attr["D0004_1500"] = f;
}
if ( attr.find("FullFileName")!= attr.end())
attr["D0004_1500"] = f;
}
if ( attr.find("FullFileName")!= attr.end())
{
if (!boost::filesystem::is_directory(itr->status()))
{
{
if (!boost::filesystem::is_directory(itr->status()))
{
- if( mReader->CanRead(itr->string()) )
+ if( mReader->CanRead(itr->path().string()) )
- names.push_back(itr->string());
+ names.push_back(itr->path().string());
- AddDirectoryRecursorScanner( itr->string(), recursive, addKey, i_sc, true);
+ AddDirectoryRecursorScanner( itr->path().string(), recursive, addKey, i_sc, true);
}
}
else
{
std::string parent_id;
// tTest if directory (and only it) exists or not.
}
}
else
{
std::string parent_id;
// tTest if directory (and only it) exists or not.
- bool valid = mSynchronizer->isIndexed(itr->string());//true;//=mTimestampHandler->AddDirectory(dirpath, itr->string(), lastModif, time(0),mCurrentDB);
+ bool valid = mSynchronizer->isIndexed(itr->path().string());//true;//=mTimestampHandler->AddDirectory(dirpath, itr->string(), lastModif, time(0),mCurrentDB);
- std::string path(itr->string());
+ std::string path(itr->path().string());
mProgress.IncNumberScannedFiles();
boost::algorithm::replace_all( path,INVALID_FILE_SEPARATOR,VALID_FILE_SEPARATOR);
mProgress.IncNumberScannedFiles();
boost::algorithm::replace_all( path,INVALID_FILE_SEPARATOR,VALID_FILE_SEPARATOR);
- i_sc.ReadAttributes(itr->string(),attr);
+ i_sc.ReadAttributes(itr->path().string(),attr);
// mTreeHandler->GetTopLevelNodeId("FullFileName",itr->string(),parent_id);
mTreeHandler->AddBranch(attr);
mProgress.IncNumberHandledFiles();
// mTreeHandler->GetTopLevelNodeId("FullFileName",itr->string(),parent_id);
mTreeHandler->AddBranch(attr);
mProgress.IncNumberHandledFiles();
- AddDirectoryRecursor( itr->string(), recursive, addKey);
+ AddDirectoryRecursor( itr->path().string(), recursive, addKey);
}
}
else
{
std::string parent_id;
// tTest if directory (and only it) exists or not.
}
}
else
{
std::string parent_id;
// tTest if directory (and only it) exists or not.
- bool valid = mSynchronizer->isIndexed(itr->string());//true;//=mTimestampHandler->AddDirectory(dirpath, itr->string(), lastModif, time(0),mCurrentDB);
+ bool valid = mSynchronizer->isIndexed(itr->path().string());//true;//=mTimestampHandler->AddDirectory(dirpath, itr->string(), lastModif, time(0),mCurrentDB);
if(valid)
{
mProgress.IncNumberScannedFiles();
if(valid)
{
mProgress.IncNumberScannedFiles();
- if (IsHandledFile(itr->string()))
+ if (IsHandledFile(itr->path().string()))
{
mProgress.IncNumberHandledFiles();
{
mProgress.IncNumberHandledFiles();
- AddFile( itr->string() );
+ AddFile( itr->path().string() );
//mTreeHandler->GetTopLevelNodeId("FullFileName",itr->string(),parent_id);
std::stringstream removedOn;
removedOn<<time(0);
//mTreeHandler->GetTopLevelNodeId("FullFileName",itr->string(),parent_id);
std::stringstream removedOn;
removedOn<<time(0);
- mSynchronizer->InsertIgnoreFile(addKey, itr->string(),"0",removedOn.str(),mCurrentDB);
+ mSynchronizer->InsertIgnoreFile(addKey, itr->path().string(),"0",removedOn.str(),mCurrentDB);
}
mProgressSignal(mProgress);
}
mProgressSignal(mProgress);
- CheckSyncDirectory( itr->string(), recursive, repair, checkAttributes, i_ignorefiles, attsModified, newfiles);
+ CheckSyncDirectory( itr->path().string(), recursive, repair, checkAttributes, i_ignorefiles, attsModified, newfiles);
- if (IsHandledFile(itr->string()))
+ if (IsHandledFile(itr->path().string()))
{
bool bfound = false;
for(std::vector<std::string>::iterator it_new = i_ignorefiles.begin(); it_new < i_ignorefiles.end(); ++it_new)
{
{
bool bfound = false;
for(std::vector<std::string>::iterator it_new = i_ignorefiles.begin(); it_new < i_ignorefiles.end(); ++it_new)
{
- if((*it_new) == itr->string())
+ if((*it_new) == itr->path().string())
{
bfound = true;
//Additional checking of attributes
{
bfound = true;
//Additional checking of attributes
}
if(!bfound && i_ignorefiles.size()>0 )
{
}
if(!bfound && i_ignorefiles.size()>0 )
{
- newfiles.push_back( itr->string() );
+ newfiles.push_back( itr->path().string() );
if ( (i = attr.find("D0004_1500")) != attr.end())
{
boost::filesystem::path full_path(filename);
if ( (i = attr.find("D0004_1500")) != attr.end())
{
boost::filesystem::path full_path(filename);
- std::string f = full_path.leaf();
+ std::string f = full_path.leaf().string();
i->second = f;
}
if ( (i = attr.find("D0028_0010")) != attr.end())
i->second = f;
}
if ( (i = attr.find("D0028_0010")) != attr.end())
if ( (i = attr.find("D0004_1500")) != attr.end())
{
boost::filesystem::path full_path(filename);
if ( (i = attr.find("D0004_1500")) != attr.end())
{
boost::filesystem::path full_path(filename);
- std::string f = full_path.leaf();
+ std::string f = full_path.leaf().string();
i->second = f;
}
if ( (i = attr.find("D0028_0010")) != attr.end())
i->second = f;
}
if ( (i = attr.find("D0028_0010")) != attr.end())
{
bvalid = m_exts.size() == 0? true : false;
std::vector<std::string>::iterator it = m_exts.begin();
{
bvalid = m_exts.size() == 0? true : false;
std::vector<std::string>::iterator it = m_exts.begin();
- std::string ext = itr->filename().substr(itr->filename().find_last_of("."));
+ std::string ext = itr->path().filename().string().substr(itr->path().filename().string().find_last_of("."));
for(; it != m_exts.end(); it++)
{
if(ext == (*it) )
for(; it != m_exts.end(); it++)
{
if(ext == (*it) )
}
if (!boost::filesystem::is_directory(itr->status()) && bvalid)
{
}
if (!boost::filesystem::is_directory(itr->status()) && bvalid)
{
- readImg(itr->string().c_str());
+ readImg(itr->path().string().c_str());
- nb += NumberFilesToAdd(itr->string(), recursive);
+ nb += NumberFilesToAdd(itr->path().string(), recursive);