virtual bool read_input_from_string (const char *s);
/**
- * Return status of this object:
- * <tt>true</tt>=clean or
- * <tt>false</tt>=error occured.
- */
- bool ok () const;
-
- /**
- * clear status bit and contents.
+ * Clear all contents.
*/
void clear ();
<< "Error when trying to convert the following string: " << arg1);
private:
- /**
- * ok bit
- */
- bool status;
-
/**
* Whatever is in a section:
* map of entry names together with
};
-/*------------------------------ Inline functions ------------------------------*/
-
-inline
-bool
-ParameterHandler::ok() const
-{
- return status;
-}
-
#endif
# include <limits>
#endif
-//TODO[WB]: Remove the "status" flag -- it's only a remnant of the DiffPack past of this class and doesn't really serve any useful purpose any more
namespace Patterns
{
-ParameterHandler::ParameterHandler ()
- :
- status(true) {}
-
-
ParameterHandler::~ParameterHandler ()
{}
std::string line;
int lineno=0;
+ bool status = true;
+
while (input)
{
++lineno;
getline (input, line);
if (!scan_line (line, lineno))
status = false;
- };
+ }
return status;
}
// to make all lines equal
if (input[input.length()-1] != '\n')
input += '\n';
-
+
+ bool status = true;
while (input.size() != 0)
{
// get one line from Input (=s)
void ParameterHandler::clear ()
{
- status = true;
-
subsection_path.clear ();
defaults.entries.clear ();
changed_entries.entries.clear ();
{
sec = sec->subsections[*SecName];
++SecName;
- };
+ }
return sec;
}
unsigned int
ParameterHandler::memory_consumption () const
{
- return (MemoryConsumption::memory_consumption (status) +
- MemoryConsumption::memory_consumption (subsection_path) +
+ return (MemoryConsumption::memory_consumption (subsection_path) +
MemoryConsumption::memory_consumption (defaults) +
MemoryConsumption::memory_consumption (changed_entries));
}
<h3>base</h3>
<ol>
+ <li> <p>
+ Removed: The <code
+ class="class">ParameterHandler</code> class contained a remnant from
+ back in 1997 when it was modeled after a similar class in DiffPack: it
+ had a <code>status</code> flag that one could obtain via the <code
+ class="member">ok</code> function. It was never really used for
+ anything, and has thus finally been removed. The <code
+ class="member">ok</code> is consequently gone as well.
+ <br>
+ (WB 2004/06/06)
+ </p>
+
<li> <p>
New: An object of the new <code
class="class">ConditionalOStream</code> class allows to print