CCAFFEINE  0.8.8
FloatJC.h
00001 #ifndef FloatJC_h_seen
00002 #define FloatJC_h_seen
00003 
00004 namespace jcpp {
00005 
00006 // requires
00007 // #include "jc++/jc++.h"
00011 class FloatJC : public virtual Object {
00012 
00013 private:
00014   float value;
00015 
00016 public:
00017 
00018   // Will NOT take NULL input for s or err.
00019   // returns -1 in err if parse fails.
00020   // returns the value, or 0.0 if err.
00021   static float valueOf0(char *s, int & NumberFormatErrJC);
00022 
00023   static CFREE char *toStringWithPrecision(float value_, int precision);
00024   
00025   static CFREE char *toString(float value_);
00026 
00027   FloatJC(float value_);
00028 
00029   FloatJC(char *s, int & NumberFormatErrJC);
00030 
00031   float floatValue();
00032 
00033   CFREE char *toString();
00034 
00035 // uses c == semantics, not javas
00036   boolean equals(Object *obj);
00037   
00038   double doubleValue();
00039 // the range sanity of the next 2 is checked. returns rangeError -1 if bad.
00040   int intValue(int &rangeError);
00041   long longValue(int &rangeError);
00042 
00043   // NumberFormatErrJC comes back -1 if bad string.
00044   static FloatJC *valueOf(char *s, int & NumberFormatErrJC);
00045 
00046   static float parseFloat(char *s, int & NumberFormatErrJC);
00047 
00048 };
00049 
00050 } ENDSEMI // jcpp
00051 #endif // FloatJC_h_seen