summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorPixel <pixel@nobis-crew.org>2011-10-10 20:31:41 -0700
committerPixel <pixel@nobis-crew.org>2011-10-10 20:31:41 -0700
commit8ae349b49e16064e4d84b6cfd256e3ca7fb0cd60 (patch)
tree8b01b3ab2097d838771d43c79b92920661ffd37c /includes
parent965148b43b5b859934b7af2e8447ba1026a43a19 (diff)
Adding the 'stats' call to Input.
Also fixing a bug with the Printer - va_args are vicious.
Diffstat (limited to 'includes')
-rw-r--r--includes/Handle.h1
-rw-r--r--includes/Input.h4
-rw-r--r--includes/Printer.h12
3 files changed, 11 insertions, 6 deletions
diff --git a/includes/Handle.h b/includes/Handle.h
index d2e1f8c..f2b78ad 100644
--- a/includes/Handle.h
+++ b/includes/Handle.h
@@ -27,6 +27,7 @@ class Handle {
virtual off_t rtell() throw (GeneralException);
virtual off_t wtell() throw (GeneralException);
virtual off_t getSize();
+ virtual time_t getMTime();
protected:
Handle() : m_refCount(0) { }
private:
diff --git a/includes/Input.h b/includes/Input.h
index 418b018..7f801f6 100644
--- a/includes/Input.h
+++ b/includes/Input.h
@@ -10,9 +10,13 @@ class Input : public SeekableHandle {
virtual void close() throw (GeneralException);
virtual bool isClosed();
virtual const char * getName();
+ virtual off_t getSize();
+ virtual time_t getMTime();
private:
int m_fd;
String m_name;
+ off_t m_size;
+ time_t m_mtime;
};
};
diff --git a/includes/Printer.h b/includes/Printer.h
index 20b3b6c..d8ba9cf 100644
--- a/includes/Printer.h
+++ b/includes/Printer.h
@@ -31,12 +31,12 @@ class Printer {
void setLocal();
static Printer * getPrinter();
- static void log(uint32_t level, const String & fmt, ...) { va_list ap; va_start(ap, fmt); log(level, fmt.to_charp(), ap); va_end(ap); }
- static void log(uint32_t level, const char * fmt, ...) { va_list ap; va_start(ap, fmt); log(level, fmt, ap); va_end(ap); }
- static void log(uint32_t level, const char * fmt, va_list ap) { getPrinter()->_log(level, fmt, ap); }
- static void print(const String & fmt, ...) { va_list ap; va_start(ap, fmt); print(fmt.to_charp(), ap); va_end(ap); }
- static void print(const char * fmt, ...) { va_list ap; va_start(ap, fmt); print(fmt, ap); va_end(ap); }
- static void print(const char * fmt, va_list ap) { getPrinter()->_print(fmt, ap); }
+ static void log(uint32_t level, const String & fmt, ...) { va_list ap; va_start(ap, fmt); vlog(level, fmt.to_charp(), ap); va_end(ap); }
+ static void log(uint32_t level, const char * fmt, ...) { va_list ap; va_start(ap, fmt); vlog(level, fmt, ap); va_end(ap); }
+ static void vlog(uint32_t level, const char * fmt, va_list ap) { getPrinter()->_log(level, fmt, ap); }
+ static void print(const String & fmt, ...) { va_list ap; va_start(ap, fmt); vprint(fmt.to_charp(), ap); va_end(ap); }
+ static void print(const char * fmt, ...) { va_list ap; va_start(ap, fmt); vprint(fmt, ap); va_end(ap); }
+ static void vprint(const char * fmt, va_list ap) { getPrinter()->_print(fmt, ap); }
static void enable(uint32_t levels = M_ALL) { getPrinter()->m_verbosity |= levels; }
static void disable(uint32_t levels = M_ALL) { getPrinter()->m_verbosity &= ~levels; }