• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kjs
 

kjs

  • KJS
  • Value
Public Member Functions | Protected Attributes | List of all members
KJS::Value Class Reference

#include <value.h>

Inheritance diagram for KJS::Value:
KJS::Boolean KJS::Completion KJS::Null KJS::Number KJS::Object KJS::Reference KJS::String KJS::Undefined

Public Member Functions

 Value (ValueImp *v)
 
 Value (const Value &v)
 
Value & operator= (const Value &v)
 
bool isValid () const
 
bool isNull () const
 
ValueImp * imp () const
 
Type type () const
 
bool isA (Type t) const
 
Value toPrimitive (ExecState *exec, Type preferredType=UnspecifiedType) const
 
bool toBoolean (ExecState *exec) const
 
double toNumber (ExecState *exec) const
 
int toInteger (ExecState *exec) const
 
int toInt32 (ExecState *exec) const
 
unsigned int toUInt32 (ExecState *exec) const
 
unsigned short toUInt16 (ExecState *exec) const
 
UString toString (ExecState *exec) const
 
Object toObject (ExecState *exec) const
 
bool toUInt32 (unsigned &i) const
 

Protected Attributes

ValueImp * rep
 

Detailed Description

Value objects are act as wrappers ("smart pointers") around ValueImp objects and their descendents.

Instead of using ValueImps (and derivatives) during normal program execution, you should use a Value-derived class.

Value maintains a pointer to a ValueImp object and uses a reference counting scheme to ensure that the ValueImp object is not deleted or garbage collected.

Note: The conversion operations all return values of various types - if an error occurs during conversion, an error object will instead be returned (where possible), and the execution state's exception will be set appropriately.

Definition at line 167 of file value.h.

Constructor & Destructor Documentation

◆ Value() [1/3]

KJS::Value::Value ( )
inline

Definition at line 169 of file value.h.

◆ Value() [2/3]

Value::Value ( ValueImp *  v)
explicit

Definition at line 225 of file value.cpp.

◆ Value() [3/3]

Value::Value ( const Value &  v)

Definition at line 240 of file value.cpp.

◆ ~Value()

Value::~Value ( )

Definition at line 254 of file value.cpp.

Member Function Documentation

◆ imp()

ValueImp * KJS::Value::imp ( ) const
inline

Definition at line 187 of file value.h.

◆ isA()

bool KJS::Value::isA ( Type  t) const
inline

Checks whether or not the value is of a particular tpye.

Parameters
tThe type to compare with
Returns
true if the value is of the specified type, otherwise false

Definition at line 203 of file value.h.

◆ isNull()

bool KJS::Value::isNull ( ) const
inline
Deprecated:
Use !isValid() instead.

Definition at line 186 of file value.h.

◆ isValid()

bool KJS::Value::isValid ( ) const
inline

Returns whether or not this is a valid value.

An invalid value has a 0 implementation pointer and should not be used for any other operation than this check. Current use: as a distinct return value signalling failing dynamicCast() calls.

Definition at line 181 of file value.h.

◆ operator=()

Value & Value::operator= ( const Value &  v)

Definition at line 263 of file value.cpp.

◆ toBoolean()

bool KJS::Value::toBoolean ( ExecState *  exec) const
inline

Performs the ToBoolean type conversion operation on this value (ECMA 9.2)

Definition at line 216 of file value.h.

◆ toInt32()

int KJS::Value::toInt32 ( ExecState *  exec) const
inline

Performs the ToInt32 type conversion operation on this value (ECMA 9.5)

Definition at line 231 of file value.h.

◆ toInteger()

int KJS::Value::toInteger ( ExecState *  exec) const
inline

Performs the ToInteger type conversion operation on this value (ECMA 9.4)

Definition at line 226 of file value.h.

◆ toNumber()

double KJS::Value::toNumber ( ExecState *  exec) const
inline

Performs the ToNumber type conversion operation on this value (ECMA 9.3)

Definition at line 221 of file value.h.

◆ toObject()

Object KJS::Value::toObject ( ExecState *  exec) const
inline

Performs the ToObject type conversion operation on this value (ECMA 9.9)

Definition at line 358 of file object.h.

◆ toPrimitive()

Value KJS::Value::toPrimitive ( ExecState *  exec,
Type  preferredType = UnspecifiedType 
) const
inline

Performs the ToPrimitive type conversion operation on this value (ECMA 9.1)

Definition at line 209 of file value.h.

◆ toString()

UString KJS::Value::toString ( ExecState *  exec) const
inline

Performs the ToString type conversion operation on this value (ECMA 9.8)

Definition at line 246 of file value.h.

◆ toUInt16()

unsigned short KJS::Value::toUInt16 ( ExecState *  exec) const
inline

Performs the ToUInt16 type conversion operation on this value (ECMA 9.7)

Definition at line 241 of file value.h.

◆ toUInt32() [1/2]

unsigned int KJS::Value::toUInt32 ( ExecState *  exec) const
inline

Performs the ToUInt32 type conversion operation on this value (ECMA 9.6)

Definition at line 236 of file value.h.

◆ toUInt32() [2/2]

bool KJS::Value::toUInt32 ( unsigned &  i) const
inline

Checks if we can do a lossless conversion to UInt32.

Definition at line 256 of file value.h.

◆ type()

Type KJS::Value::type ( ) const
inline

Returns the type of value.

This is one of UndefinedType, NullType, BooleanType, StringType, NumberType, or ObjectType.

Returns
The type of value

Definition at line 195 of file value.h.

Member Data Documentation

◆ rep

ValueImp* KJS::Value::rep
protected

Definition at line 259 of file value.h.


The documentation for this class was generated from the following files:
  • value.h
  • object.h
  • value.cpp

kjs

Skip menu "kjs"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

kjs

Skip menu "kjs"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for kjs by doxygen 1.9.4
This website is maintained by Timothy Pearson.