]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
- allow to rename AsciiFile and SysconigFile
authorArvin Schnell <aschnell@suse.de>
Mon, 16 Feb 2015 10:52:44 +0000 (11:52 +0100)
committerArvin Schnell <aschnell@suse.de>
Mon, 16 Feb 2015 10:52:44 +0000 (11:52 +0100)
snapper/AsciiFile.cc
snapper/AsciiFile.h

index 750e68c18f40f1b5c2f527436aa8e93a4a88b435..f08a8d1707bf54a0d91dfe2f305fa78d06f35e81 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) [2004-2013] Novell, Inc.
+ * Copyright (c) [2004-2015] Novell, Inc.
  *
  * All Rights Reserved.
  *
@@ -197,6 +197,13 @@ AsciiFile::save()
     }
 
 
+    void
+    SysconfigFile::setValue(const string& key, const char* value)
+    {
+       setValue(key, string(value));
+    }
+
+
     void
     SysconfigFile::setValue(const string& key, const string& value)
     {
index 3f67dbb2383232f4b47009bfe1260f33a8713950..2d6df7a60fdc2f69898a83bd07e0dda2fb0df95e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) [2004-2013] Novell, Inc.
+ * Copyright (c) [2004-2015] Novell, Inc.
  *
  * All Rights Reserved.
  *
@@ -67,6 +67,8 @@ namespace snapper
 
        string name() const { return Name_C; }
 
+       void setName(const string& name) { AsciiFile::Name_C = name; }
+
        void reload();
        bool save();
 
@@ -80,13 +82,14 @@ namespace snapper
 
     protected:
 
-       const string Name_C;
-       const bool remove_empty;
-
        vector<string> Lines_C;
 
-    };
+    private:
 
+       string Name_C;
+       bool remove_empty;
+
+    };
 
 
     class SysconfigFile : protected AsciiFile
@@ -103,6 +106,8 @@ namespace snapper
        SysconfigFile(const string& name) : AsciiFile(name), modified(false) {}
        virtual ~SysconfigFile() { if (modified) save(); }
 
+       void setName(const string& name) { AsciiFile::setName(name); }
+
        void save();
 
        virtual void checkKey(const string& key) const;
@@ -110,6 +115,7 @@ namespace snapper
        virtual void setValue(const string& key, bool value);
        bool getValue(const string& key, bool& value) const;
 
+       virtual void setValue(const string& key, const char* value);
        virtual void setValue(const string& key, const string& value);
        bool getValue(const string& key, string& value) const;