]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
- make some variables private
authorArvin Schnell <aschnell@suse.de>
Wed, 19 Jan 2011 17:36:30 +0000 (18:36 +0100)
committerArvin Schnell <aschnell@suse.de>
Wed, 19 Jan 2011 17:36:30 +0000 (18:36 +0100)
snapper/File.cc
snapper/File.h
snapper/Snapper.cc
tools/snapper.cc

index d8f13d16c7d3c6ece67a3a57d5fc19f7ef954f34..44dd4e55ee9e2bbd3892b0681a222bce3119a92a 100644 (file)
@@ -118,7 +118,7 @@ namespace snapper
        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);
@@ -158,7 +158,7 @@ namespace snapper
     inline bool
     file_name_less(const File& file, const string& name)
     {
-       return file.name < name;
+       return file.getName() < name;
     }
 
 
@@ -176,13 +176,6 @@ namespace snapper
     }
 
 
-    unsigned int
-    File::getPreToPostStatus()
-    {
-       return pre_to_post_status;
-    }
-
-
     unsigned int
     File::getPreToSystemStatus()
     {
index 5b04cd06dd7a68bd05887278aaabee26b3a54c6d..97f90c2ad4558c02edafffa656ad9f58526887c5 100644 (file)
@@ -44,15 +44,20 @@ namespace snapper
 
        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
 
@@ -63,7 +68,7 @@ namespace snapper
 
     inline int operator<(const File& a, const File& b)
     {
-       return a.name < b.name;
+       return a.getName() < b.getName();
     }
 
 
index 1bb99f26cb22dd19345d2176c823b529918e4633..49cea99539a23faf285a36d70fe95c00bcc1fa39 100644 (file)
@@ -139,7 +139,7 @@ namespace snapper
     {
        vector<File>::iterator it = filelist.find(name);
        if (it != filelist.end())
-           it->rollback = rollback;
+           it->setRollback(rollback);
     }
 
 
@@ -148,7 +148,7 @@ namespace snapper
     {
        vector<File>::const_iterator it = filelist.find(name);
        if (it != filelist.end())
-           return it->rollback;
+           return it->getRollback();
        return false;
     }
 
index bc13fde4b483b78d5ebf470ea1c1e3b016a0fae7..d2179c9f91f65be995956a29bcb9c7f8ec3e7bce 100644 (file)
@@ -109,7 +109,7 @@ void showDifference( const list<string>& args )
     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