number_object.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _NUMBER_OBJECT_H_
00023 #define _NUMBER_OBJECT_H_
00024
00025 #include "internal.h"
00026 #include "function_object.h"
00027
00028 namespace KJS {
00029
00030 class NumberInstanceImp : public ObjectImp {
00031 public:
00032 NumberInstanceImp(ObjectImp *proto);
00033
00034 virtual const ClassInfo *classInfo() const { return &info; }
00035 static const ClassInfo info;
00036 };
00037
00044 class NumberPrototypeImp : public NumberInstanceImp {
00045 public:
00046 NumberPrototypeImp(ExecState *exec,
00047 ObjectPrototypeImp *objProto,
00048 FunctionPrototypeImp *funcProto);
00049 };
00050
00057 class NumberProtoFuncImp : public InternalFunctionImp {
00058 public:
00059 NumberProtoFuncImp(ExecState *exec, FunctionPrototypeImp *funcProto,
00060 int i, int len, const Identifier &_ident);
00061
00062 virtual bool implementsCall() const;
00063 virtual Value call(ExecState *exec, Object &thisObj, const List &args);
00064
00065 enum { ToString, ToLocaleString, ValueOf, ToFixed, ToExponential, ToPrecision };
00066 private:
00067 int id;
00068 };
00069
00075 class NumberObjectImp : public InternalFunctionImp {
00076 public:
00077 NumberObjectImp(ExecState *exec,
00078 FunctionPrototypeImp *funcProto,
00079 NumberPrototypeImp *numberProto);
00080
00081 virtual bool implementsConstruct() const;
00082 virtual Object construct(ExecState *exec, const List &args);
00083
00084 virtual bool implementsCall() const;
00085 virtual Value call(ExecState *exec, Object &thisObj, const List &args);
00086
00087 Value get(ExecState *exec, const Identifier &p) const;
00088 Value getValueProperty(ExecState *exec, int token) const;
00089 virtual const ClassInfo *classInfo() const { return &info; }
00090 static const ClassInfo info;
00091 enum { NaNValue, NegInfinity, PosInfinity, MaxValue, MinValue };
00092
00093 Completion execute(const List &);
00094 Object construct(const List &);
00095 };
00096
00097 }
00098
00099 #endif
|