C++ Rest SDK
The C++ REST SDK is a Microsoft project for cloud-based client-server communication in native code using a modern asynchronous C++ API design. This project aims to help C++ developers connect to and interact with services.
Public Member Functions | Friends | List of all members
web::json::number Class Reference

A JSON number represented as a C++ class. More...

#include <json.h>

Public Member Functions

_ASYNCRTIMP bool is_int32 () const
 Does the number fit into int32? More...
 
_ASYNCRTIMP bool is_uint32 () const
 Does the number fit into unsigned int32? More...
 
_ASYNCRTIMP bool is_int64 () const
 Does the number fit into int64? More...
 
bool is_uint64 () const
 Does the number fit into unsigned int64? More...
 
double to_double () const
 Converts the JSON number to a C++ double. More...
 
int32_t to_int32 () const
 Converts the JSON number to int32. More...
 
uint32_t to_uint32 () const
 Converts the JSON number to unsigned int32. More...
 
int64_t to_int64 () const
 Converts the JSON number to int64. More...
 
uint64_t to_uint64 () const
 Converts the JSON number to unsigned int64. More...
 
bool is_integral () const
 Is the number represented internally as an integral type? More...
 
bool operator== (const number &other) const
 Compares two JSON numbers for equality. More...
 

Friends

class details::_Number
 

Detailed Description

A JSON number represented as a C++ class.

Member Function Documentation

_ASYNCRTIMP bool web::json::number::is_int32 ( ) const

Does the number fit into int32?

Returns
true if the number fits into int32, false otherwise
_ASYNCRTIMP bool web::json::number::is_int64 ( ) const

Does the number fit into int64?

Returns
true if the number fits into int64, false otherwise
bool web::json::number::is_integral ( ) const
inline

Is the number represented internally as an integral type?

Returns
true if the number is represented as an integral type, false otherwise
_ASYNCRTIMP bool web::json::number::is_uint32 ( ) const

Does the number fit into unsigned int32?

Returns
true if the number fits into unsigned int32, false otherwise
bool web::json::number::is_uint64 ( ) const
inline

Does the number fit into unsigned int64?

Returns
true if the number fits into unsigned int64, false otherwise
bool web::json::number::operator== ( const number other) const
inline

Compares two JSON numbers for equality.

Parameters
otherThe JSON number to compare with.
Returns
True iff the numbers are equal.
double web::json::number::to_double ( ) const
inline

Converts the JSON number to a C++ double.

Returns
A double representation of the number
int32_t web::json::number::to_int32 ( ) const
inline

Converts the JSON number to int32.

Returns
An int32 representation of the number
int64_t web::json::number::to_int64 ( ) const
inline

Converts the JSON number to int64.

Returns
An int64 representation of the number
uint32_t web::json::number::to_uint32 ( ) const
inline

Converts the JSON number to unsigned int32.

Returns
An usigned int32 representation of the number
uint64_t web::json::number::to_uint64 ( ) const
inline

Converts the JSON number to unsigned int64.

Returns
An unsigned int64 representation of the number

The documentation for this class was generated from the following file: