fgms 0.11.8
The
FlightGear MultiPlayer Server
project
fg_util.cxx File Reference
#include <fg_util.hxx>
#include <stdio.h>

Go to the source code of this file.

Functions

string byte_counter (double bytes)
 
string diff_to_days (time_t Date)
 convert a time duration expressed in seconds to a string representation of the form "3 days 2 hours" More...
 
string timestamp_to_datestr (time_t date)
 convert a unix timestamp to a string representation of a date More...
 
string timestamp_to_days (time_t Date)
 calculate the difference of a timestamp to now and convert the difference to a string representation of the form "3 days 2 hours" More...
 

Function Documentation

string byte_counter ( double  bytes)

Convert a byte counter to a string representation of the form "3.7 Gib" (3.7 Gigibit). The units conform to IEC, see http://physics.nist.gov/cuu/Units/binary.html

Definition at line 100 of file fg_util.cxx.

Referenced by FG_CLI::cmd_blacklist_show(), FG_CLI::cmd_crossfeed_show(), FG_CLI::cmd_relay_show(), FG_CLI::cmd_show_stats(), FG_CLI::cmd_tracker_show(), and FG_CLI::cmd_user_show().

string diff_to_days ( time_t  Date)

convert a time duration expressed in seconds to a string representation of the form "3 days 2 hours"

Definition at line 52 of file fg_util.cxx.

Referenced by mT_FG_List< T >::CheckTTL(), mT_FG_List< T >::Find(), and timestamp_to_days().

string timestamp_to_datestr ( time_t  date)

convert a unix timestamp to a string representation of a date

Definition at line 11 of file fg_util.cxx.

Referenced by FG_CLI::cmd_blacklist_show(), FG_CLI::cmd_crossfeed_show(), FG_CLI::cmd_relay_show(), FG_CLI::cmd_show_uptime(), FG_CLI::cmd_tracker_show(), and FG_CLI::cmd_user_show().

string timestamp_to_days ( time_t  Date)

calculate the difference of a timestamp to now and convert the difference to a string representation of the form "3 days 2 hours"

Definition at line 36 of file fg_util.cxx.

Referenced by FG_CLI::cmd_blacklist_show(), FG_CLI::cmd_crossfeed_show(), FG_CLI::cmd_show_uptime(), FG_CLI::cmd_tracker_show(), and FG_CLI::cmd_user_show().