+ make RecoveryWriter more robust

This commit is contained in:
wmayer
2015-09-18 15:32:33 +02:00
parent bb05d17596
commit 8db1280a4d
4 changed files with 67 additions and 24 deletions

View File

@@ -264,7 +264,7 @@ void FileWriter::putNextEntry(const char* file)
this->FileStream.open(fileName.c_str(), std::ios::out);
}
bool FileWriter::shouldWrite(const Base::Persistence *) const
bool FileWriter::shouldWrite(const std::string& , const Base::Persistence *) const
{
return true;
}
@@ -278,7 +278,7 @@ void FileWriter::writeFiles(void)
while (index < FileList.size()) {
FileEntry entry = FileList.begin()[index];
if (shouldWrite(entry.Object)) {
if (shouldWrite(entry.FileName, entry.Object)) {
std::string filePath = entry.FileName;
std::string::size_type pos = 0;
while ((pos = filePath.find("/", pos)) != std::string::npos) {

View File

@@ -165,7 +165,7 @@ private:
std::stringstream StrStream;
};
/*! The FileWriter class
/*! The FileWriter class
This class writes out the data into files into a given directory name.
\see Base::Persistence
\author Werner Mayer
@@ -185,7 +185,7 @@ public:
to write out certain objects. The default implementation
always returns true.
*/
virtual bool shouldWrite(const Base::Persistence *Object) const;
virtual bool shouldWrite(const std::string& name, const Base::Persistence *Object) const;
private:
std::string DirName;