Mercurial > octave-nkf
diff liboctave/mach-info.h @ 2317:8c09c04f7747
[project @ 1996-07-14 22:30:15 by jwe]
author | jwe |
---|---|
date | Sun, 14 Jul 1996 22:40:35 +0000 |
parents | 1b57120c997b |
children | 8b262e771614 |
line wrap: on
line diff
--- a/liboctave/mach-info.h Fri Jul 12 18:52:41 1996 +0000 +++ b/liboctave/mach-info.h Sun Jul 14 22:40:35 1996 +0000 @@ -20,25 +20,59 @@ */ -#if !defined (octave_float_fmt_h) -#define octave_float_fmt_h 1 +#if !defined (octave_mach_info_h) +#define octave_mach_info_h 1 + +#include <string> + +class +oct_mach_info +{ +public: + + enum float_format + { + native, + unknown, + ieee_little_endian, + ieee_big_endian, + vax_d, + vax_g, + cray + }; + + oct_mach_info (void); + + static float_format native_float_format (void); + + static bool words_big_endian (void); -enum floating_point_format - { - OCTAVE_IEEE_LITTLE, - OCTAVE_IEEE_BIG, - OCTAVE_VAX_D, - OCTAVE_VAX_G, - OCTAVE_CRAY, - OCTAVE_UNKNOWN_FLT_FMT - }; + static bool words_little_endian (void); + + static float_format string_to_float_format (const string&); + + static string float_format_as_string (float_format); + +private: + + static oct_mach_info *instance; + + void init_float_format (void); -// The floating point format on this system. -extern floating_point_format native_float_format; + void ten_little_endians (void); + + // The floating point format for the current machine. + float_format native_float_fmt; -// Initializes the value of native_float_format. Maybe this should be -// done automatically using a class with a static member. Hmm... -extern int float_format_init (void); + // TRUE if the byte order on this system is big endian. + bool big_chief; + + // No copying! + + oct_mach_info (const oct_mach_info&); + + oct_mach_info& operator = (const oct_mach_info&); +}; #endif