Fawkes API  Fawkes Development Version
xabsl_tools.h
1 
2 /***************************************************************************
3  * xabsl_tools.h - Tools required for XABSL
4  *
5  * Created: Wed Aug 06 17:20:37 2008
6  * Copyright 2006-2008 Tim Niemueller [www.niemueller.de]
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Library General Public License for more details.
19  *
20  * Read the full text in the LICENSE.GPL file in the doc directory.
21  */
22 
23 #ifndef __PLUGINS_XABSL_XABSL_TOOLS_H_
24 #define __PLUGINS_XABSL_XABSL_TOOLS_H_
25 
26 #include <XabslEngine/XabslTools.h>
27 
28 #include <cstdio>
29 
30 namespace fawkes {
31  class Logger;
32 }
33 
34 class XabslLoggingErrorHandler : public xabsl::ErrorHandler
35 {
36  public:
38 
39  virtual void printError(const char *text);
40  virtual void printMessage(const char *text);
41 
42  private:
43  fawkes::Logger *__logger;
44 };
45 
46 
47 class XabslFileInputSource : public xabsl::InputSource
48 {
49  public:
50  XabslFileInputSource(const char* filename);
52 
53  virtual bool open();
54  virtual void close();
55 
56  virtual double readValue() ;
57  virtual bool readString(char* destination, int maxLength);
58 
59  private:
60  char read_and_omit_whitespace(bool omit_whitespace);
61  bool read_from_file(char *buf, size_t buf_length);
62  void omit_comment();
63 
64  private:
65  char *__filename;
66  FILE *__f;
67 };
68 
69 #endif
Fawkes library namespace.
File input class for Xabsl integration.
Definition: xabsl_tools.h:47
Logging error handler for XABSL integration.
Definition: xabsl_tools.h:34
Interface for logging.
Definition: logger.h:34