aws-crt-cpp
C++ wrapper around the aws-c-* libraries. Provides Cross-Platform Transport Protocols and SSL/TLS implementations for C++.
Classes | Namespaces | Macros | Typedefs | Functions | Variables
cJSON.cpp File Reference
#include <string.h>
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <limits.h>
#include <ctype.h>
#include <float.h>
#include <aws/crt/external/cJSON.h>

Classes

struct  error
 
struct  Aws::internal_hooks
 
struct  Aws::parse_buffer
 
struct  Aws::printbuffer
 

Namespaces

namespace  Aws
 

Macros

#define isinf(d)   (isnan((d - d)) && !isnan(d))
 
#define isnan(d)   (d != d)
 
#define NAN   0.0/0.0
 
#define internal_malloc   malloc
 
#define internal_free   free
 
#define internal_realloc   realloc
 
#define static_strlen(string_literal)   (sizeof(string_literal) - sizeof(""))
 
#define can_read(buffer, size)   ((buffer != NULL) && (((buffer)->offset + size) <= (buffer)->length))
 
#define can_access_at_index(buffer, index)   ((buffer != NULL) && (((buffer)->offset + index) < (buffer)->length))
 
#define cannot_access_at_index(buffer, index)   (!can_access_at_index(buffer, index))
 
#define buffer_at_offset(buffer)   ((buffer)->content + (buffer)->offset)
 
#define cjson_min(a, b)   (((a) < (b)) ? (a) : (b))
 

Typedefs

typedef struct Aws::internal_hooks Aws::internal_hooks
 

Functions

 Aws::CJSON_PUBLIC (const char *) cJSON_Version(void)
 
 Aws::CJSON_PUBLIC (char *) cJSON_Print(const cJSON *item)
 
 Aws::CJSON_PUBLIC (double) cJSON_GetNumberValue(const cJSON *const item)
 
static int Aws::case_insensitive_strcmp (const unsigned char *string1, const unsigned char *string2)
 
static unsigned char * Aws::cJSON_strdup (const unsigned char *string, const internal_hooks *const hooks)
 
 Aws::CJSON_PUBLIC (void) cJSON_InitHooks(cJSON_Hooks *hooks)
 
static cJSON * Aws::cJSON_New_Item (const internal_hooks *const hooks)
 
static unsigned char Aws::get_decimal_point (void)
 
static cJSON_bool Aws::parse_number (cJSON *const item, parse_buffer *const input_buffer)
 
 Aws::if (!(object->type &cJSON_String)||(object->type &cJSON_IsReference))
 
 Aws::if (strlen(valuestring)<=strlen(object->valuestring))
 
 Aws::if (copy==NULL)
 
 Aws::if (object->valuestring !=NULL)
 
static unsigned char * Aws::ensure (printbuffer *const p, size_t needed)
 
static void Aws::update_offset (printbuffer *const buffer)
 
static cJSON_bool Aws::compare_double (double a, double b)
 
static cJSON_bool Aws::print_number (const cJSON *const item, printbuffer *const output_buffer)
 
static unsigned Aws::parse_hex4 (const unsigned char *const input)
 
static unsigned char Aws::utf16_literal_to_utf8 (const unsigned char *const input_pointer, const unsigned char *const input_end, unsigned char **output_pointer)
 
static cJSON_bool Aws::parse_string (cJSON *const item, parse_buffer *const input_buffer)
 
static cJSON_bool Aws::print_string_ptr (const unsigned char *const input, printbuffer *const output_buffer)
 
static cJSON_bool Aws::print_string (const cJSON *const item, printbuffer *const p)
 
static cJSON_bool Aws::parse_value (cJSON *const item, parse_buffer *const input_buffer)
 
static cJSON_bool Aws::print_value (const cJSON *const item, printbuffer *const output_buffer)
 
static cJSON_bool Aws::parse_array (cJSON *const item, parse_buffer *const input_buffer)
 
static cJSON_bool Aws::print_array (const cJSON *const item, printbuffer *const output_buffer)
 
static cJSON_bool Aws::parse_object (cJSON *const item, parse_buffer *const input_buffer)
 
static cJSON_bool Aws::print_object (const cJSON *const item, printbuffer *const output_buffer)
 
static parse_buffer * Aws::buffer_skip_whitespace (parse_buffer *const buffer)
 
static parse_buffer * Aws::skip_utf8_bom (parse_buffer *const buffer)
 
 Aws::CJSON_PUBLIC (cJSON *) cJSON_Parse(const char *value)
 
 Aws::if (NULL==value)
 
return Aws::cJSON_ParseWithLengthOpts (value, buffer_length, return_parse_end, require_null_terminated)
 
 Aws::if (value==NULL||0==buffer_length)
 
 Aws::if (item==NULL)
 
 Aws::if (!parse_value(item, buffer_skip_whitespace(skip_utf8_bom(&buffer))))
 
 Aws::if (require_null_terminated)
 
 Aws::if (return_parse_end)
 
 Aws::if (value !=NULL)
 
static unsigned char * Aws::print (const cJSON *const item, cJSON_bool format, const internal_hooks *const hooks)
 
 Aws::if (prebuffer< 0)
 
 Aws::if (!p.buffer)
 
 Aws::if (!print_value(item, &p))
 
 Aws::return (char *) p.buffer
 
 Aws::CJSON_PUBLIC (cJSON_bool) cJSON_PrintPreallocated(cJSON *item
 
 Aws::if ((length< 0)||(buffer==NULL))
 
return Aws::print_value (item, &p)
 
static cJSON * Aws::get_array_item (const cJSON *array, size_t index)
 
static cJSON * Aws::get_object_item (const cJSON *const object, const char *const name, const cJSON_bool case_sensitive)
 
static void Aws::suffix_object (cJSON *prev, cJSON *item)
 
static cJSON * Aws::create_reference (const cJSON *item, const internal_hooks *const hooks)
 
static cJSON_bool Aws::add_item_to_array (cJSON *array, cJSON *item)
 
static void * Aws::cast_away_const (const void *string)
 
static cJSON_bool Aws::add_item_to_object (cJSON *const object, const char *const string, cJSON *const item, const internal_hooks *const hooks, const cJSON_bool constant_key)
 
 Aws::if (add_item_to_object(object, name, null, &global_hooks, false))
 
 Aws::cJSON_Delete (null)
 
 Aws::if (add_item_to_object(object, name, true_item, &global_hooks, false))
 
 Aws::cJSON_Delete (true_item)
 
 Aws::if (add_item_to_object(object, name, false_item, &global_hooks, false))
 
 Aws::cJSON_Delete (false_item)
 
 Aws::if (add_item_to_object(object, name, bool_item, &global_hooks, false))
 
 Aws::cJSON_Delete (bool_item)
 
 Aws::if (add_item_to_object(object, name, number_item, &global_hooks, false))
 
 Aws::cJSON_Delete (number_item)
 
 Aws::if (add_item_to_object(object, name, string_item, &global_hooks, false))
 
 Aws::cJSON_Delete (string_item)
 
 Aws::if (add_item_to_object(object, name, raw_item, &global_hooks, false))
 
 Aws::cJSON_Delete (raw_item)
 
 Aws::if (add_item_to_object(object, name, object_item, &global_hooks, false))
 
 Aws::cJSON_Delete (object_item)
 
 Aws::if (add_item_to_object(object, name, array, &global_hooks, false))
 
 Aws::cJSON_Delete (array)
 
return Aws::cJSON_DetachItemViaPointer (object, to_detach)
 
 Aws::if (after_inserted==NULL)
 
 Aws::if (replacement->next !=NULL)
 
 Aws::if (parent->child==item)
 
 Aws::cJSON_Delete (item)
 
static cJSON_bool Aws::replace_item_in_object (cJSON *object, const char *string, cJSON *replacement, cJSON_bool case_sensitive)
 
 Aws::if ((count< 0)||(numbers==NULL))
 
 Aws::for (i=0;a &&(i<(size_t) count);i++)
 
 Aws::if ((count< 0)||(strings==NULL))
 
 Aws::if (!item)
 
 Aws::if (item->valuestring)
 
 Aws::while (child !=NULL)
 
 Aws::if (newitem &&newitem->child)
 
static void Aws::skip_oneline_comment (char **input)
 
static void Aws::skip_multiline_comment (char **input)
 
static void Aws::minify_string (char **input, char **output)
 

Variables

static error global_error = { NULL, 0 }
 
static internal_hooks Aws::global_hooks = { internal_malloc, internal_free, internal_realloc }
 
 Aws::copy = (char*) cJSON_strdup((const unsigned char*)valuestring, &global_hooks)
 
global_error Aws::json = NULL
 
global_error Aws::position = 0
 
buffer Aws::content = (const unsigned char*)value
 
buffer Aws::offset = 0
 
buffer Aws::hooks = global_hooks
 
fail Aws::__pad0__
 
return Aws::NULL
 
Aws::noalloc = false
 
item Aws::next = NULL
 
 Aws::after_inserted = get_array_item(array, (size_t)which)
 
newitem Aws::prev = after_inserted->prev
 
 Aws::else
 
return Aws::true
 
cJSON * Aws::n = NULL
 
cJSON * Aws::p = NULL
 
cJSON * Aws::a = NULL
 
cJSON * Aws::child = NULL
 
cJSON * Aws::newchild = NULL
 
newitem Aws::type = item->type & (~cJSON_IsReference)
 
newitem Aws::valueint = item->valueint
 
newitem Aws::valuedouble = item->valuedouble
 
fail Aws::__pad1__
 

Macro Definition Documentation

◆ buffer_at_offset

#define buffer_at_offset (   buffer)    ((buffer)->content + (buffer)->offset)

◆ can_access_at_index

#define can_access_at_index (   buffer,
  index 
)    ((buffer != NULL) && (((buffer)->offset + index) < (buffer)->length))

◆ can_read

#define can_read (   buffer,
  size 
)    ((buffer != NULL) && (((buffer)->offset + size) <= (buffer)->length))

◆ cannot_access_at_index

#define cannot_access_at_index (   buffer,
  index 
)    (!can_access_at_index(buffer, index))

◆ cjson_min

#define cjson_min (   a,
 
)    (((a) < (b)) ? (a) : (b))

◆ internal_free

#define internal_free   free

◆ internal_malloc

#define internal_malloc   malloc

◆ internal_realloc

#define internal_realloc   realloc

◆ isinf

#define isinf (   d)    (isnan((d - d)) && !isnan(d))

MODIFICATIONS: valueInt was moved up to improve alignment. Wrap all symbols in the Aws namespace as a short-term collision resolution Replace strcpy() with strncpy()

Modifications licensed under:

Copyright 2010-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at

http://aws.amazon.com/apache2.0

or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

◆ isnan

#define isnan (   d)    (d != d)

◆ NAN

#define NAN   0.0/0.0

◆ static_strlen

#define static_strlen (   string_literal)    (sizeof(string_literal) - sizeof(""))

Variable Documentation

◆ global_error

error global_error = { NULL, 0 }
static