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
:
37
XabslLoggingErrorHandler
(
fawkes::Logger
*logger);
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
class
XabslFileInputSource
:
public
xabsl::InputSource
47
{
48
public
:
49
XabslFileInputSource
(
const
char
*filename);
50
~XabslFileInputSource
();
51
52
virtual
bool
open
();
53
virtual
void
close
();
54
55
virtual
double
readValue
();
56
virtual
bool
readString
(
char
*destination,
int
maxLength);
57
58
private
:
59
char
read_and_omit_whitespace(
bool
omit_whitespace);
60
bool
read_from_file(
char
*buf,
size_t
buf_length);
61
void
omit_comment();
62
63
private
:
64
char
*filename_;
65
FILE *f_;
66
};
67
68
#endif
XabslFileInputSource::close
virtual void close()
Close file.
Definition:
xabsl_tools.cpp:97
XabslFileInputSource::open
virtual bool open()
Open file.
Definition:
xabsl_tools.cpp:88
XabslFileInputSource::XabslFileInputSource
XabslFileInputSource(const char *filename)
Constructor.
Definition:
xabsl_tools.cpp:71
XabslFileInputSource
Definition:
xabsl_tools.h:46
XabslFileInputSource::readString
virtual bool readString(char *destination, int maxLength)
Read a string from the file.
Definition:
xabsl_tools.cpp:126
fawkes::Logger
Definition:
logger.h:41
fawkes
XabslLoggingErrorHandler
Definition:
xabsl_tools.h:34
XabslFileInputSource::readValue
virtual double readValue()
Read a double value from the file.
Definition:
xabsl_tools.cpp:108
XabslLoggingErrorHandler::printError
virtual void printError(const char *text)
Print error message.
Definition:
xabsl_tools.cpp:49
XabslFileInputSource::~XabslFileInputSource
~XabslFileInputSource()
Destructor.
Definition:
xabsl_tools.cpp:78
XabslLoggingErrorHandler::printMessage
virtual void printMessage(const char *text)
Print info message.
Definition:
xabsl_tools.cpp:58
XabslLoggingErrorHandler::XabslLoggingErrorHandler
XabslLoggingErrorHandler(fawkes::Logger *logger)
Constructor.
Definition:
xabsl_tools.cpp:40
src
plugins
xabsl
xabsl_tools.h
Generated by
1.8.17