]> git.mxchange.org Git - flightgear.git/blob - src/Main/util.hxx
Clean-up cmake (linker) dependencies.
[flightgear.git] / src / Main / util.hxx
1 // util.hxx - general-purpose utility functions.
2 // Copyright (C) 2002  Curtis L. Olson  - http://www.flightgear.org/~curt
3 //
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License as
6 // published by the Free Software Foundation; either version 2 of the
7 // License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful, but
10 // WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 // General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17 //
18 // $Id$
19
20
21 #ifndef __UTIL_HXX
22 #define __UTIL_HXX 1
23
24 #ifndef __cplusplus
25 # error This library requires C++
26 #endif
27
28
29 /**
30  * Move a value towards a target.
31  *
32  * This function was originally written by Alex Perry.
33  *
34  * @param current The current value.
35  * @param target The target value.
36  * @param timeratio The percentage of smoothing time that has passed 
37  *        (elapsed time/smoothing time)
38  * @return The new value.
39  */
40 extern double fgGetLowPass (double current, double target, double timeratio);
41
42
43 /**
44  * Unescape string.
45  *
46  * @param str String possibly containing escaped characters.
47  * @return string with escaped characters replaced by single character values.
48  */
49 extern std::string fgUnescape (const char *str);
50
51
52 /**
53  * Validation listener interface for io.nas, used by fgcommands.
54  * @param path Path to be validated
55  * @param write True for write operations and false for read operations.
56  * @return The validated path on success or 0 if access denied.
57  */
58 extern const char *fgValidatePath (const char *path, bool write);
59
60 #endif // __UTIL_HXX