]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
- mark some variables private
authorArvin Schnell <aschnell@suse.de>
Wed, 2 Feb 2011 16:25:57 +0000 (17:25 +0100)
committerArvin Schnell <aschnell@suse.de>
Wed, 2 Feb 2011 16:25:57 +0000 (17:25 +0100)
snapper/File.cc
snapper/Snapshot.cc
snapper/Snapshot.h

index e3015708cf52bfcaf7a0fbbd3e7cf594ec7cc5a9..9b8a2a5b83558781da7b5a4424b7af6e84ac9b86 100644 (file)
@@ -51,7 +51,7 @@ namespace snapper
     void
     Files::create()
     {
-       y2mil("num1:" << snapshot1->num << " num2:" << snapshot2->num);
+       y2mil("num1:" << snapshot1->getNum() << " num2:" << snapshot2->getNum());
 
        if (compare_callback)
            compare_callback->start();
@@ -112,9 +112,10 @@ namespace snapper
     bool
     Files::save()
     {
-       y2mil("num1:" << snapshot1->num << " num2:" << snapshot2->num);
+       y2mil("num1:" << snapshot1->getNum() << " num2:" << snapshot2->getNum());
 
-       string output = snapshot2->baseDir() + "/filelist-" + decString(snapshot1->num) + ".txt";
+       string output = snapshot2->baseDir() + "/filelist-" + decString(snapshot1->getNum()) +
+           ".txt";
 
        char* tmp_name = (char*) malloc(output.length() + 12);
        strcpy(tmp_name, output.c_str());
index 9cef3dd6e477b582698b4d1d4f3c54c16735a346..bbb7e33ae993998e535ecba91d49f193688cc891 100644 (file)
@@ -252,7 +252,7 @@ namespace snapper
     inline bool
     snapshot_num_less(const Snapshot& snapshot, unsigned int num)
     {
-       return snapshot.num < num;
+       return snapshot.getNum() < num;
     }
 
 
index 9848acf2d835ef78436f5e87de7fea300991cf7a..2bf08278a308f6215cc55ca98ad142b629ac48eb 100644 (file)
@@ -39,8 +39,29 @@ namespace snapper
     {
     public:
 
+       friend class Snapshots;
+
        Snapshot() : type(SINGLE), num(0), pre_num(0) {}
 
+       SnapshotType getType() const { return type; }
+
+       unsigned int getNum() const { return num; }
+
+       string getDate() const { return date; }
+
+       string getDescription() const { return description; }
+
+       unsigned int getPreNum() const { return pre_num; }
+
+       string baseDir() const;
+       string snapshotDir() const;
+
+       friend std::ostream& operator<<(std::ostream& s, const Snapshot& x);
+
+       friend bool operator<(const Snapshot& a, const Snapshot& b);
+
+    private:
+
        SnapshotType type;
 
        unsigned int num;
@@ -51,18 +72,12 @@ namespace snapper
 
        unsigned int pre_num;   // valid only for type=POST
 
-       string baseDir() const;
-       string snapshotDir() const;
-
        bool writeInfo() const;
        bool createFilesystemSnapshot() const;
 
     };
 
 
-    std::ostream& operator<<(std::ostream& s, const Snapshot& x);
-
-
     inline bool operator<(const Snapshot& a, const Snapshot& b)
     {
        return a.num < b.num;