]> git.mxchange.org Git - flightgear.git/blob - src/Main/util.hxx
Update image-server logic.
[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 #ifndef __UTIL_HXX
21 #define __UTIL_HXX 1
22
23 #include <string>
24
25 /**
26  * Move a value towards a target.
27  *
28  * This function was originally written by Alex Perry.
29  *
30  * @param current The current value.
31  * @param target The target value.
32  * @param timeratio The percentage of smoothing time that has passed 
33  *        (elapsed time/smoothing time)
34  * @return The new value.
35  */
36 double fgGetLowPass (double current, double target, double timeratio);
37
38 /**
39  * Validation listener interface for io.nas, used by fgcommands.
40  * @param path Path to be validated
41  * @param write True for write operations and false for read operations.
42  * @return The validated path on success or 0 if access denied.
43  */
44 const char *fgValidatePath (const char *path, bool write);
45 std::string fgValidatePath(const std::string& path, bool write);
46
47 #endif // __UTIL_HXX