\section{KJS::Value Class Reference}
\label{classKJS_1_1Value}\index{KJS::Value@{KJS::Value}}
{\bf Value}{\rm (p.\,\pageref{classKJS_1_1Value})} objects are act as wrappers (\char`\"{}smart pointers\char`\"{}) around {\bf Value\-Imp}{\rm (p.\,\pageref{classKJS_1_1ValueImp})} objects and their descendents.  


{\tt \#include $<$value.h$>$}

Inheritance diagram for KJS::Value:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=114pt]{classKJS_1_1Value__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KJS::Value:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=59pt]{classKJS_1_1Value__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf Value} ({\bf Value\-Imp} $\ast$v)\label{classKJS_1_1Value_a1}

\item 
{\bf Value} (const {\bf Value} \&v)\label{classKJS_1_1Value_a2}

\item 
{\bf Value} \& {\bf operator=} (const {\bf Value} \&v)\label{classKJS_1_1Value_a4}

\item 
bool {\bf is\-Valid} () const 
\item 
bool {\bf is\-Null} () const 
\item 
{\bf Value\-Imp} $\ast$ {\bf imp} () const \label{classKJS_1_1Value_a7}

\item 
Type {\bf type} () const 
\item 
bool {\bf is\-A} (Type t) const 
\item 
{\bf Value} {\bf to\-Primitive} ({\bf Exec\-State} $\ast$exec, Type preferred\-Type=Unspecified\-Type) const 
\item 
bool {\bf to\-Boolean} ({\bf Exec\-State} $\ast$exec) const 
\item 
double {\bf to\-Number} ({\bf Exec\-State} $\ast$exec) const 
\item 
int {\bf to\-Integer} ({\bf Exec\-State} $\ast$exec) const 
\item 
int {\bf to\-Int32} ({\bf Exec\-State} $\ast$exec) const 
\item 
unsigned int {\bf to\-UInt32} ({\bf Exec\-State} $\ast$exec) const 
\item 
unsigned short {\bf to\-UInt16} ({\bf Exec\-State} $\ast$exec) const 
\item 
{\bf UString} {\bf to\-String} ({\bf Exec\-State} $\ast$exec) const 
\item 
{\bf Object} {\bf to\-Object} ({\bf Exec\-State} $\ast$exec) const 
\item 
bool {\bf to\-UInt32} (unsigned \&i) const 
\end{CompactItemize}
\subsection*{Protected Attributes}
\begin{CompactItemize}
\item 
{\bf Value\-Imp} $\ast$ {\bf rep}\label{classKJS_1_1Value_p0}

\end{CompactItemize}


\subsection{Detailed Description}
{\bf Value}{\rm (p.\,\pageref{classKJS_1_1Value})} objects are act as wrappers (\char`\"{}smart pointers\char`\"{}) around {\bf Value\-Imp}{\rm (p.\,\pageref{classKJS_1_1ValueImp})} objects and their descendents. 

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

{\bf Value}{\rm (p.\,\pageref{classKJS_1_1Value})} maintains a pointer to a {\bf Value\-Imp}{\rm (p.\,\pageref{classKJS_1_1ValueImp})} object and uses a reference counting scheme to ensure that the {\bf Value\-Imp}{\rm (p.\,\pageref{classKJS_1_1ValueImp})} 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 169 of file value.h.

\subsection{Member Function Documentation}
\index{KJS::Value@{KJS::Value}!isValid@{isValid}}
\index{isValid@{isValid}!KJS::Value@{KJS::Value}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KJS::Value::is\-Valid () const\hspace{0.3cm}{\tt  [inline]}}\label{classKJS_1_1Value_a5}


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 dynamic\-Cast() calls. 

Definition at line 183 of file value.h.\index{KJS::Value@{KJS::Value}!isNull@{isNull}}
\index{isNull@{isNull}!KJS::Value@{KJS::Value}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KJS::Value::is\-Null () const\hspace{0.3cm}{\tt  [inline]}}\label{classKJS_1_1Value_a6}


\begin{Desc}
\item[{\bf Deprecated}]Use !is\-Valid() instead. \end{Desc}


Definition at line 188 of file value.h.

Referenced by KJS::Reference::get\-Value().\index{KJS::Value@{KJS::Value}!type@{type}}
\index{type@{type}!KJS::Value@{KJS::Value}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Type KJS::Value::type () const\hspace{0.3cm}{\tt  [inline]}}\label{classKJS_1_1Value_a8}


Returns the type of value. 

This is one of Undefined\-Type, Null\-Type, Boolean\-Type, String\-Type, Number\-Type, or Object\-Type.

\begin{Desc}
\item[Returns:]The type of value \end{Desc}


Definition at line 197 of file value.h.

Referenced by KJS::Reference::get\-Value(), and KJS::Reference::put\-Value().\index{KJS::Value@{KJS::Value}!isA@{isA}}
\index{isA@{isA}!KJS::Value@{KJS::Value}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KJS::Value::is\-A (Type {\em t}) const\hspace{0.3cm}{\tt  [inline]}}\label{classKJS_1_1Value_a9}


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

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em t}]The type to compare with \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if the value is of the specified type, otherwise false \end{Desc}


Definition at line 205 of file value.h.\index{KJS::Value@{KJS::Value}!toPrimitive@{toPrimitive}}
\index{toPrimitive@{toPrimitive}!KJS::Value@{KJS::Value}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Value} KJS::Value::to\-Primitive ({\bf Exec\-State} $\ast$ {\em exec}, Type {\em preferred\-Type} = {\tt UnspecifiedType}) const\hspace{0.3cm}{\tt  [inline]}}\label{classKJS_1_1Value_a10}


Performs the To\-Primitive type conversion operation on this value (ECMA 9.1). 



Definition at line 211 of file value.h.\index{KJS::Value@{KJS::Value}!toBoolean@{toBoolean}}
\index{toBoolean@{toBoolean}!KJS::Value@{KJS::Value}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KJS::Value::to\-Boolean ({\bf Exec\-State} $\ast$ {\em exec}) const\hspace{0.3cm}{\tt  [inline]}}\label{classKJS_1_1Value_a11}


Performs the To\-Boolean type conversion operation on this value (ECMA 9.2). 



Definition at line 218 of file value.h.\index{KJS::Value@{KJS::Value}!toNumber@{toNumber}}
\index{toNumber@{toNumber}!KJS::Value@{KJS::Value}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}double KJS::Value::to\-Number ({\bf Exec\-State} $\ast$ {\em exec}) const\hspace{0.3cm}{\tt  [inline]}}\label{classKJS_1_1Value_a12}


Performs the To\-Number type conversion operation on this value (ECMA 9.3). 



Definition at line 223 of file value.h.\index{KJS::Value@{KJS::Value}!toInteger@{toInteger}}
\index{toInteger@{toInteger}!KJS::Value@{KJS::Value}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KJS::Value::to\-Integer ({\bf Exec\-State} $\ast$ {\em exec}) const\hspace{0.3cm}{\tt  [inline]}}\label{classKJS_1_1Value_a13}


Performs the To\-Integer type conversion operation on this value (ECMA 9.4). 



Definition at line 228 of file value.h.\index{KJS::Value@{KJS::Value}!toInt32@{toInt32}}
\index{toInt32@{toInt32}!KJS::Value@{KJS::Value}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KJS::Value::to\-Int32 ({\bf Exec\-State} $\ast$ {\em exec}) const\hspace{0.3cm}{\tt  [inline]}}\label{classKJS_1_1Value_a14}


Performs the To\-Int32 type conversion operation on this value (ECMA 9.5). 



Definition at line 233 of file value.h.\index{KJS::Value@{KJS::Value}!toUInt32@{toUInt32}}
\index{toUInt32@{toUInt32}!KJS::Value@{KJS::Value}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned int KJS::Value::to\-UInt32 ({\bf Exec\-State} $\ast$ {\em exec}) const\hspace{0.3cm}{\tt  [inline]}}\label{classKJS_1_1Value_a15}


Performs the To\-UInt32 type conversion operation on this value (ECMA 9.6). 



Definition at line 238 of file value.h.\index{KJS::Value@{KJS::Value}!toUInt16@{toUInt16}}
\index{toUInt16@{toUInt16}!KJS::Value@{KJS::Value}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned short KJS::Value::to\-UInt16 ({\bf Exec\-State} $\ast$ {\em exec}) const\hspace{0.3cm}{\tt  [inline]}}\label{classKJS_1_1Value_a16}


Performs the To\-UInt16 type conversion operation on this value (ECMA 9.7). 



Definition at line 243 of file value.h.\index{KJS::Value@{KJS::Value}!toString@{toString}}
\index{toString@{toString}!KJS::Value@{KJS::Value}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf UString} KJS::Value::to\-String ({\bf Exec\-State} $\ast$ {\em exec}) const\hspace{0.3cm}{\tt  [inline]}}\label{classKJS_1_1Value_a17}


Performs the To\-String type conversion operation on this value (ECMA 9.8). 



Definition at line 248 of file value.h.\index{KJS::Value@{KJS::Value}!toObject@{toObject}}
\index{toObject@{toObject}!KJS::Value@{KJS::Value}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Object} KJS::Value::to\-Object ({\bf Exec\-State} $\ast$ {\em exec}) const\hspace{0.3cm}{\tt  [inline]}}\label{classKJS_1_1Value_a18}


Performs the To\-Object type conversion operation on this value (ECMA 9.9). 



Definition at line 357 of file object.h.

References KJS::Value\-Imp::dispatch\-To\-Object().\index{KJS::Value@{KJS::Value}!toUInt32@{toUInt32}}
\index{toUInt32@{toUInt32}!KJS::Value@{KJS::Value}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KJS::Value::to\-UInt32 (unsigned \& {\em i}) const\hspace{0.3cm}{\tt  [inline]}}\label{classKJS_1_1Value_a19}


Checks if we can do a lossless conversion to UInt32. 



Definition at line 258 of file value.h.

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
value.h\item 
object.h\item 
value.cpp\end{CompactItemize}
