StringValue Class Reference

This class represents string values. More...

#include <value.h>

Inheritance diagram for StringValue:

Value List of all members.

Public Member Functions

 StringValue ()
 Default constructor.
 StringValue (const Ustr &value)
 Construct a string value with the given std::string.
virtual ~StringValue ()
 Destructor is declared virtual, as it always should be.
ValueType GetType () const
 Return this instance's type.
virtual std::string AsString () const
 Gets the value as a string.
virtual Ustr AsUstr () const
 Gets the value as a string.
virtual long AsInt () const
 Attempts to get the value as an int.
virtual double AsFloat () const
 Attempts to get the value as a float.

Detailed Description

This class represents string values.

Author:
Matthew Welch


Constructor & Destructor Documentation

StringValue::StringValue (  )  [inline]

Default constructor.

StringValue::StringValue ( const Ustr value  )  [inline]

Construct a string value with the given std::string.

Parameters:
value String value to assign.

virtual StringValue::~StringValue (  )  [inline, virtual]

Destructor is declared virtual, as it always should be.


Member Function Documentation

ValueType StringValue::GetType (  )  const [inline, virtual]

Return this instance's type.

Returns:
ValueType enum of this intance's type.

Implements Value.

virtual std::string StringValue::AsString (  )  const [inline, virtual]

Gets the value as a string.

Reimplemented from Value.

virtual Ustr StringValue::AsUstr (  )  const [inline, virtual]

Gets the value as a string.

Reimplemented from Value.

virtual long StringValue::AsInt (  )  const [inline, virtual]

Attempts to get the value as an int.

This method performs an atoi() on the string and returns the result. If the string does not represent an integer value it will return 0.

Reimplemented from Value.

virtual double StringValue::AsFloat (  )  const [inline, virtual]

Attempts to get the value as a float.

This method performs an atof() on the string and returns the result. If the string does not represent a float value it will return 0.

Reimplemented from Value.


The documentation for this class was generated from the following file:
Generated on Wed Apr 18 15:50:12 2007 for JSON Parser by  doxygen 1.5.2