\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=121pt]{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 
\begin{CompactList}\small\item\em Returns whether or not this is a valid value. \item\end{CompactList}\item 
bool {\bf is\-Null} () const 
\begin{CompactList}\small\item\em {\bf This class or method is obsolete, it is provided for compatibility only.} Use !is\-Valid() instead. \item\end{CompactList}\item 
{\bf Value\-Imp} $\ast$ {\bf imp} () const \label{classKJS_1_1Value_a7}

\item 
Type {\bf type} () const 
\begin{CompactList}\small\item\em Returns the type of value. \item\end{CompactList}\item 
bool {\bf is\-A} (Type t) const 
\begin{CompactList}\small\item\em Checks whether or not the value is of a particular tpye. \item\end{CompactList}\item 
{\bf Value} {\bf to\-Primitive} ({\bf Exec\-State} $\ast$exec, Type preferred\-Type=Unspecified\-Type) const 
\begin{CompactList}\small\item\em Performs the To\-Primitive type conversion operation on this value (ECMA 9.1). \item\end{CompactList}\item 
bool {\bf to\-Boolean} ({\bf Exec\-State} $\ast$exec) const 
\begin{CompactList}\small\item\em Performs the To\-Boolean type conversion operation on this value (ECMA 9.2). \item\end{CompactList}\item 
double {\bf to\-Number} ({\bf Exec\-State} $\ast$exec) const 
\begin{CompactList}\small\item\em Performs the To\-Number type conversion operation on this value (ECMA 9.3). \item\end{CompactList}\item 
int {\bf to\-Integer} ({\bf Exec\-State} $\ast$exec) const 
\begin{CompactList}\small\item\em Performs the To\-Integer type conversion operation on this value (ECMA 9.4). \item\end{CompactList}\item 
int {\bf to\-Int32} ({\bf Exec\-State} $\ast$exec) const 
\begin{CompactList}\small\item\em Performs the To\-Int32 type conversion operation on this value (ECMA 9.5). \item\end{CompactList}\item 
unsigned int {\bf to\-UInt32} ({\bf Exec\-State} $\ast$exec) const 
\begin{CompactList}\small\item\em Performs the To\-Uint32 type conversion operation on this value (ECMA 9.6). \item\end{CompactList}\item 
unsigned short {\bf to\-UInt16} ({\bf Exec\-State} $\ast$exec) const 
\begin{CompactList}\small\item\em Performs the To\-Uint16 type conversion operation on this value (ECMA 9.7). \item\end{CompactList}\item 
{\bf UString} {\bf to\-String} ({\bf Exec\-State} $\ast$exec) const 
\begin{CompactList}\small\item\em Performs the To\-String type conversion operation on this value (ECMA 9.8). \item\end{CompactList}\item 
{\bf Object} {\bf to\-Object} ({\bf Exec\-State} $\ast$exec) const 
\begin{CompactList}\small\item\em Performs the To\-Object type conversion operation on this value (ECMA 9.9). \item\end{CompactList}\item 
{\bf Value} {\bf get\-Base} ({\bf Exec\-State} $\ast$exec) const 
\begin{CompactList}\small\item\em Performs the Get\-Base type conversion operation on this value (ECMA 8.7). \item\end{CompactList}\item 
{\bf UString} {\bf get\-Property\-Name} ({\bf Exec\-State} $\ast$exec) const 
\begin{CompactList}\small\item\em Performs the Get\-Property\-Name type conversion operation on this value (ECMA 8.7). \item\end{CompactList}\item 
{\bf Value} {\bf get\-Value} ({\bf Exec\-State} $\ast$exec) const 
\begin{CompactList}\small\item\em Performs the Get\-Value type conversion operation on this value (ECMA 8.7.1). \item\end{CompactList}\item 
void {\bf put\-Value} ({\bf Exec\-State} $\ast$exec, const  {\bf Value} w)
\begin{CompactList}\small\item\em Performs the Put\-Value type conversion operation on this value (ECMA 8.7.1). \item\end{CompactList}\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 156 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 Value::is\-Valid () const}\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 219 of file value.cpp.\index{KJS::Value@{KJS::Value}!isNull@{isNull}}
\index{isNull@{isNull}!KJS::Value@{KJS::Value}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool Value::is\-Null () const}\label{classKJS_1_1Value_a6}


{\bf This class or method is obsolete, it is provided for compatibility only.} Use !is\-Valid() instead. 



Definition at line 224 of file value.cpp.

Referenced by KJS::Number::dynamic\-Cast(), KJS::String::dynamic\-Cast(), KJS::Boolean::dynamic\-Cast(), KJS::Null::dynamic\-Cast(), KJS::Undefined::dynamic\-Cast(), KJS::Completion::dynamic\-Cast(), KJS::List::dynamic\-Cast(), and KJS::Object::dynamic\-Cast().\index{KJS::Value@{KJS::Value}!type@{type}}
\index{type@{type}!KJS::Value@{KJS::Value}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Type Value::type () const}\label{classKJS_1_1Value_a8}


Returns the type of value. 

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

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


Definition at line 234 of file value.cpp.

References KJS::Value\-Imp::type().

Referenced by KJS::Number::dynamic\-Cast(), KJS::String::dynamic\-Cast(), KJS::Boolean::dynamic\-Cast(), KJS::Null::dynamic\-Cast(), KJS::Undefined::dynamic\-Cast(), KJS::Completion::dynamic\-Cast(), KJS::List::dynamic\-Cast(), KJS::Object::dynamic\-Cast(), and is\-A().\index{KJS::Value@{KJS::Value}!isA@{isA}}
\index{isA@{isA}!KJS::Value@{KJS::Value}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool Value::is\-A (Type {\em t}) const}\label{classKJS_1_1Value_a9}


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

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em 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 239 of file value.cpp.

References type().\index{KJS::Value@{KJS::Value}!toPrimitive@{toPrimitive}}
\index{toPrimitive@{toPrimitive}!KJS::Value@{KJS::Value}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Value} Value::to\-Primitive ({\bf Exec\-State} $\ast$ {\em exec}, Type {\em preferred\-Type} = Unspecified\-Type) const}\label{classKJS_1_1Value_a10}


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



Definition at line 244 of file value.cpp.

References KJS::Value\-Imp::to\-Primitive().\index{KJS::Value@{KJS::Value}!toBoolean@{toBoolean}}
\index{toBoolean@{toBoolean}!KJS::Value@{KJS::Value}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool Value::to\-Boolean ({\bf Exec\-State} $\ast$ {\em exec}) const}\label{classKJS_1_1Value_a11}


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



Definition at line 249 of file value.cpp.

References KJS::Value\-Imp::to\-Boolean().\index{KJS::Value@{KJS::Value}!toNumber@{toNumber}}
\index{toNumber@{toNumber}!KJS::Value@{KJS::Value}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}double Value::to\-Number ({\bf Exec\-State} $\ast$ {\em exec}) const}\label{classKJS_1_1Value_a12}


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



Definition at line 254 of file value.cpp.

References KJS::Value\-Imp::to\-Number().\index{KJS::Value@{KJS::Value}!toInteger@{toInteger}}
\index{toInteger@{toInteger}!KJS::Value@{KJS::Value}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Value::to\-Integer ({\bf Exec\-State} $\ast$ {\em exec}) const}\label{classKJS_1_1Value_a13}


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



Definition at line 259 of file value.cpp.

References KJS::Value\-Imp::to\-Integer().\index{KJS::Value@{KJS::Value}!toInt32@{toInt32}}
\index{toInt32@{toInt32}!KJS::Value@{KJS::Value}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Value::to\-Int32 ({\bf Exec\-State} $\ast$ {\em exec}) const}\label{classKJS_1_1Value_a14}


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



Definition at line 264 of file value.cpp.

References KJS::Value\-Imp::to\-Int32().\index{KJS::Value@{KJS::Value}!toUInt32@{toUInt32}}
\index{toUInt32@{toUInt32}!KJS::Value@{KJS::Value}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned int Value::to\-UInt32 ({\bf Exec\-State} $\ast$ {\em exec}) const}\label{classKJS_1_1Value_a15}


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



Definition at line 269 of file value.cpp.

References KJS::Value\-Imp::to\-UInt32().\index{KJS::Value@{KJS::Value}!toUInt16@{toUInt16}}
\index{toUInt16@{toUInt16}!KJS::Value@{KJS::Value}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned short Value::to\-UInt16 ({\bf Exec\-State} $\ast$ {\em exec}) const}\label{classKJS_1_1Value_a16}


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



Definition at line 274 of file value.cpp.

References KJS::Value\-Imp::to\-UInt16().\index{KJS::Value@{KJS::Value}!toString@{toString}}
\index{toString@{toString}!KJS::Value@{KJS::Value}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf UString} Value::to\-String ({\bf Exec\-State} $\ast$ {\em exec}) const}\label{classKJS_1_1Value_a17}


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



Definition at line 279 of file value.cpp.

References KJS::Value\-Imp::to\-String().\index{KJS::Value@{KJS::Value}!toObject@{toObject}}
\index{toObject@{toObject}!KJS::Value@{KJS::Value}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Object} Value::to\-Object ({\bf Exec\-State} $\ast$ {\em exec}) const}\label{classKJS_1_1Value_a18}


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



Definition at line 284 of file value.cpp.

References KJS::Value\-Imp::to\-Object().\index{KJS::Value@{KJS::Value}!getBase@{getBase}}
\index{getBase@{getBase}!KJS::Value@{KJS::Value}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Value} Value::get\-Base ({\bf Exec\-State} $\ast$ {\em exec}) const}\label{classKJS_1_1Value_a19}


Performs the Get\-Base type conversion operation on this value (ECMA 8.7). 

Since references are supposed to have an {\bf Object}{\rm (p.\,\pageref{classKJS_1_1Object})} or null as their base, this method is guaranteed to return either Null() or an {\bf Object}{\rm (p.\,\pageref{classKJS_1_1Object})} value. 

Definition at line 290 of file value.cpp.

References KJS::Value\-Imp::get\-Base().\index{KJS::Value@{KJS::Value}!getPropertyName@{getPropertyName}}
\index{getPropertyName@{getPropertyName}!KJS::Value@{KJS::Value}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf UString} Value::get\-Property\-Name ({\bf Exec\-State} $\ast$ {\em exec}) const}\label{classKJS_1_1Value_a20}


Performs the Get\-Property\-Name type conversion operation on this value (ECMA 8.7). 



Definition at line 296 of file value.cpp.

References KJS::Value\-Imp::get\-Property\-Name().\index{KJS::Value@{KJS::Value}!getValue@{getValue}}
\index{getValue@{getValue}!KJS::Value@{KJS::Value}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Value} Value::get\-Value ({\bf Exec\-State} $\ast$ {\em exec}) const}\label{classKJS_1_1Value_a21}


Performs the Get\-Value type conversion operation on this value (ECMA 8.7.1). 



Definition at line 302 of file value.cpp.

References KJS::Value\-Imp::get\-Value().\index{KJS::Value@{KJS::Value}!putValue@{putValue}}
\index{putValue@{putValue}!KJS::Value@{KJS::Value}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Value::put\-Value ({\bf Exec\-State} $\ast$ {\em exec}, const {\bf Value} {\em w})}\label{classKJS_1_1Value_a22}


Performs the Put\-Value type conversion operation on this value (ECMA 8.7.1). 



Definition at line 308 of file value.cpp.

References KJS::Value\-Imp::put\-Value().

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