diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2012-12-06 10:29:23 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2012-12-06 10:29:23 +0100 |
commit | 9a0236b9e249f002accfb222a969be0c676115b7 (patch) | |
tree | 716651c5a29f20266b8074fb8301ce2be9f93c98 /tools.h | |
parent | c005465d9005c7b8918564055639c1766c099121 (diff) | |
download | vdr-9a0236b9e249f002accfb222a969be0c676115b7.tar.gz vdr-9a0236b9e249f002accfb222a969be0c676115b7.tar.bz2 |
Changed reading and writing of floating point numbers into configuration files to make it independent of the decimal point used in the current locale
Diffstat (limited to 'tools.h')
-rw-r--r-- | tools.h | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: tools.h 2.22 2012/09/30 11:02:21 kls Exp $ + * $Id: tools.h 2.23 2012/12/06 08:59:39 kls Exp $ */ #ifndef __TOOLS_H @@ -216,6 +216,14 @@ int64_t StrToNum(const char *s); bool StrInArray(const char *a[], const char *s); ///< Returns true if the string s is equal to one of the strings pointed ///< to by the (NULL terminated) array a. +double atod(const char *s); + ///< Converts the given string, which is a floating point number using a '.' as + ///< the decimal point, to a double value, independent of the currently selected + ///< locale. +cString dtoa(double d, const char *Format = "%f"); + ///< Converts the given double value to a string, making sure it uses a '.' as + ///< the decimal point, independent of the currently selected locale. + ///< If Format is given, it will be used instead of the default. cString itoa(int n); cString AddDirectory(const char *DirName, const char *FileName); bool EntriesOnSameFileSystem(const char *File1, const char *File2); |