xabsl_tools.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __PLUGINS_XABSL_XABSL_TOOLS_H_
00024 #define __PLUGINS_XABSL_XABSL_TOOLS_H_
00025
00026 #include <XabslEngine/XabslTools.h>
00027
00028 #include <cstdio>
00029
00030 namespace fawkes {
00031 class Logger;
00032 }
00033
00034 class XabslLoggingErrorHandler : public xabsl::ErrorHandler
00035 {
00036 public:
00037 XabslLoggingErrorHandler(fawkes::Logger *logger);
00038
00039 virtual void printError(const char *text);
00040 virtual void printMessage(const char *text);
00041
00042 private:
00043 fawkes::Logger *__logger;
00044 };
00045
00046
00047 class XabslFileInputSource : public xabsl::InputSource
00048 {
00049 public:
00050 XabslFileInputSource(const char* filename);
00051 ~XabslFileInputSource();
00052
00053 virtual bool open();
00054 virtual void close();
00055
00056 virtual double readValue() ;
00057 virtual bool readString(char* destination, int maxLength);
00058
00059 private:
00060 char read_and_omit_whitespace(bool omit_whitespace);
00061 bool read_from_file(char *buf, size_t buf_length);
00062 void omit_comment();
00063
00064 private:
00065 char *__filename;
00066 FILE *__f;
00067 };
00068
00069 #endif