FILE* file = fdopen(fd, "w");
for (vector<File>::const_iterator it = files.begin(); it != files.end(); ++it)
- fprintf(file, "%s %s\n", statusToString(it->pre_to_post_status).c_str(),
+ fprintf(file, "%s %s\n", statusToString(it->getPreToPostStatus()).c_str(),
it->getName().c_str());
fclose(file);
inline bool
file_name_less(const File& file, const string& name)
{
- return file.name < name;
+ return file.getName() < name;
}
}
- unsigned int
- File::getPreToPostStatus()
- {
- return pre_to_post_status;
- }
-
-
unsigned int
File::getPreToSystemStatus()
{
const string& getName() const { return name; }
- string name;
-
- unsigned int getPreToPostStatus();
+ unsigned int getPreToPostStatus() const { return pre_to_post_status; }
unsigned int getPreToSystemStatus();
unsigned int getPostToSystemStatus();
unsigned int getStatus(Cmp cmp);
- unsigned int pre_to_post_status; // -1 if invalid
+ bool getRollback() const { return rollback; }
+ void setRollback(bool value) { rollback = value; }
+
+ private:
+
+ string name;
+
+ unsigned int pre_to_post_status;
unsigned int pre_to_system_status; // -1 if invalid
unsigned int post_to_system_status; // -1 if invalid
inline int operator<(const File& a, const File& b)
{
- return a.name < b.name;
+ return a.getName() < b.getName();
}
{
vector<File>::iterator it = filelist.find(name);
if (it != filelist.end())
- it->rollback = rollback;
+ it->setRollback(rollback);
}
{
vector<File>::const_iterator it = filelist.find(name);
if (it != filelist.end())
- return it->rollback;
+ return it->getRollback();
return false;
}
setComparisonNums(n1, n2);
for (vector<File>::const_iterator it = filelist.begin(); it != filelist.end(); ++it)
- cout << statusToString(it->pre_to_post_status) << " " << it->name << endl;
+ cout << statusToString(it->getPreToPostStatus()) << " " << it->getName() << endl;
}
int