Added OnStart() hook.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6012 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Tyler Dauwalder 2004-01-11 05:40:53 +00:00
parent 5c11a9047a
commit d59c2deed2
3 changed files with 20 additions and 0 deletions

View File

@ -15,6 +15,9 @@
#include <stdio.h>
#include <string.h>
static const char * const kDivider =
"----------------------------------------------------------------------";
/*! \brief Creates a new ConsoleListener object with the given verbosity level.
All output from said listener is sent to standard output via printf().
@ -29,6 +32,19 @@ ConsoleListener::ConsoleListener(VerbosityLevel level)
{
}
void
ConsoleListener::OnStart(const char *sourceDirectory, const char *outputFile,
const char *udfVolumeName) const
{
if (Level() > VERBOSITY_NONE) {
printf("%s\n", kDivider);
printf("Source directory: `%s'\n", sourceDirectory);
printf("Output file: `%s'\n", outputFile);
printf("UDF Volume Name: `%s'\n", udfVolumeName);
printf("%s\n", kDivider);
}
}
void
ConsoleListener::OnError(const char *message) const
{

View File

@ -19,6 +19,8 @@
class ConsoleListener : public ProgressListener {
public:
ConsoleListener(VerbosityLevel level);
virtual void OnStart(const char *sourceDirectory, const char *outputFile,
const char *udfVolumeName) const;
virtual void OnError(const char *message) const;
virtual void OnWarning(const char *message) const;
virtual void OnUpdate(VerbosityLevel level, const char *message) const;

View File

@ -25,6 +25,8 @@ enum VerbosityLevel {
class ProgressListener {
public:
virtual void OnStart(const char *sourceDirectory, const char *outputFile,
const char *udfVolumeName) const = 0;
virtual void OnError(const char *message) const = 0;
virtual void OnWarning(const char *message) const = 0;
virtual void OnUpdate(VerbosityLevel level, const char *message) const = 0;