--- a/src/core/default-value.h Mon Jul 23 15:16:45 2007 +0200
+++ b/src/core/default-value.h Mon Jul 23 15:22:36 2007 +0200
@@ -37,6 +37,19 @@
virtual ~DefaultValueBase ();
std::string GetName (void) const;
std::string GetHelp (void) const;
+
+ /**
+ * \returns true if this value is dirty, false otherwise.
+ *
+ * A value becomes dirty when ParseValue is invoked
+ * and it successfully completes. Dirtyness indicates
+ * that the state of the value was changed by a user.
+ */
+ bool IsDirty (void) const;
+ /**
+ * Clear the dirty state.
+ */
+ void ClearDirtyFlag (void);
// parse a matching parameter
// return true in case of success, false otherwise.
bool ParseValue (const std::string &value);
@@ -46,11 +59,14 @@
DefaultValueBase (const std::string &name,
const std::string &help);
private:
+ DefaultValueBase ();
+private:
virtual bool DoParseValue (const std::string &value) = 0;
virtual std::string DoGetType (void) const = 0;
virtual std::string DoGetDefaultValue (void) const = 0;
std::string m_name;
std::string m_help;
+ bool m_dirty;
};
class DefaultValueList