aws-crt-cpp
C++ wrapper around the aws-c-* libraries. Provides Cross-Platform Transport Protocols and SSL/TLS implementations for C++.
Namespaces | Classes | Typedefs | Functions | Variables
Aws Namespace Reference

Namespaces

namespace  Crt
 
namespace  Iot
 

Classes

struct  cJSON
 
struct  cJSON_Hooks
 
struct  internal_hooks
 
struct  parse_buffer
 
struct  printbuffer
 

Typedefs

typedef struct Aws::cJSON cJSON
 
typedef struct Aws::cJSON_Hooks cJSON_Hooks
 
typedef int cJSON_bool
 
typedef struct Aws::internal_hooks internal_hooks
 

Functions

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

Variables

size_t buffer_length = strlen(value) + sizeof("")
 
const char ** return_parse_end
 
const char cJSON_bool require_null_terminated
 
int prebuffer
 
int cJSON_bool fmt
 
char * buffer = (unsigned char*)global_hooks.allocate((size_t)prebuffer)
 
char const int length = buffer_length
 
char const int const cJSON_bool format = fmt
 
int index
 
const char *const string
 
int count
 
cJSONitem = NULL
 
int which
 
int cJSONnewitem
 
cJSON *const cJSONreplacement
 
cJSON_bool recurse
 
const cJSON *const b
 
const cJSON *const const cJSON_bool case_sensitive
 
const char *const name
 
const char *const const cJSON_bool boolean
 
const char *const const double number
 
const char *const const char *const raw
 
const char * valuestring
 
static internal_hooks global_hooks = { internal_malloc, internal_free, internal_realloc }
 
 copy = (char*) cJSON_strdup((const unsigned char*)valuestring, &global_hooks)
 
global_error json = NULL
 
global_error position = 0
 
buffer content = (const unsigned char*)value
 
buffer offset = 0
 
buffer hooks = global_hooks
 
fail __pad0__
 
return NULL
 
p noalloc = false
 
item next = NULL
 
 after_inserted = get_array_item(array, (size_t)which)
 
newitem prev = after_inserted->prev
 
 else
 
return true
 
cJSONn = NULL
 
cJSONp = NULL
 
cJSONa = NULL
 
cJSONchild = NULL
 
cJSONnewchild = NULL
 
newitem type = item->type & (~cJSON_IsReference)
 
newitem valueint = item->valueint
 
newitem valuedouble = item->valuedouble
 
fail __pad1__
 

Detailed Description

Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0.

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.

Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0. To keep ABI compatability, we use CRT's own string view implementation even for C++ 17.

Typedef Documentation

◆ cJSON

typedef struct Aws::cJSON Aws::cJSON

◆ cJSON_bool

typedef int Aws::cJSON_bool

◆ cJSON_Hooks

◆ internal_hooks

Function Documentation

◆ add_item_to_array()

static cJSON_bool Aws::add_item_to_array ( cJSON array,
cJSON item 
)
static

◆ add_item_to_object()

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 
)
static

◆ buffer_skip_whitespace()

static parse_buffer * Aws::buffer_skip_whitespace ( parse_buffer *const  buffer)
static

◆ case_insensitive_strcmp()

static int Aws::case_insensitive_strcmp ( const unsigned char *  string1,
const unsigned char *  string2 
)
static

◆ cast_away_const()

static void * Aws::cast_away_const ( const void *  string)
static

◆ cJSON_Delete() [1/10]

Aws::cJSON_Delete ( array  )

◆ cJSON_Delete() [2/10]

Aws::cJSON_Delete ( bool_item  )

◆ cJSON_Delete() [3/10]

Aws::cJSON_Delete ( false_item  )

◆ cJSON_Delete() [4/10]

Aws::cJSON_Delete ( item  )

◆ cJSON_Delete() [5/10]

Aws::cJSON_Delete ( null  )

◆ cJSON_Delete() [6/10]

Aws::cJSON_Delete ( number_item  )

◆ cJSON_Delete() [7/10]

Aws::cJSON_Delete ( object_item  )

◆ cJSON_Delete() [8/10]

Aws::cJSON_Delete ( raw_item  )

◆ cJSON_Delete() [9/10]

Aws::cJSON_Delete ( string_item  )

◆ cJSON_Delete() [10/10]

Aws::cJSON_Delete ( true_item  )

◆ cJSON_DetachItemViaPointer()

return Aws::cJSON_DetachItemViaPointer ( object  ,
to_detach   
)

◆ cJSON_New_Item()

static cJSON * Aws::cJSON_New_Item ( const internal_hooks *const  hooks)
static

◆ cJSON_ParseWithLengthOpts()

return Aws::cJSON_ParseWithLengthOpts ( value  ,
buffer_length  ,
return_parse_end  ,
require_null_terminated   
)

◆ CJSON_PUBLIC() [1/7]

Aws::CJSON_PUBLIC ( char *  ) const

◆ CJSON_PUBLIC() [2/7]

Aws::CJSON_PUBLIC ( cJSON ) const

◆ CJSON_PUBLIC() [3/7]

Aws::CJSON_PUBLIC ( cJSON_bool  )

◆ CJSON_PUBLIC() [4/7]

Aws::CJSON_PUBLIC ( const char *  )

◆ CJSON_PUBLIC() [5/7]

Aws::CJSON_PUBLIC ( double  ) const

◆ CJSON_PUBLIC() [6/7]

Aws::CJSON_PUBLIC ( void *  )

◆ CJSON_PUBLIC() [7/7]

Aws::CJSON_PUBLIC ( void  )

◆ cJSON_strdup()

static unsigned char * Aws::cJSON_strdup ( const unsigned char *  string,
const internal_hooks *const  hooks 
)
static

◆ compare_double()

static cJSON_bool Aws::compare_double ( double  a,
double  b 
)
static

◆ create_reference()

static cJSON * Aws::create_reference ( const cJSON item,
const internal_hooks *const  hooks 
)
static

◆ ensure()

static unsigned char * Aws::ensure ( printbuffer *const  p,
size_t  needed 
)
static

◆ for()

Aws::for ( = 0; a && (i < (size_t)count); i++)

◆ get_array_item()

static cJSON * Aws::get_array_item ( const cJSON array,
size_t  index 
)
static

◆ get_decimal_point()

static unsigned char Aws::get_decimal_point ( void  )
static

◆ get_object_item()

static cJSON * Aws::get_object_item ( const cJSON *const  object,
const char *const  name,
const cJSON_bool  case_sensitive 
)
static

◆ if() [1/32]

Aws::if ( object->type &cJSON_String)||(object->type &cJSON_IsReference)

◆ if() [2/32]

Aws::if ( item)

◆ if() [3/32]

Aws::if ( !p.  buffer)

◆ if() [4/32]

Aws::if ( parse_valueitem, buffer_skip_whitespace(skip_utf8_bom(&buffer)))

◆ if() [5/32]

Aws::if ( print_valueitem, &p)

◆ if() [6/32]

Aws::if ( (count< 0)||(numbers==NULL )

◆ if() [7/32]

Aws::if ( (count< 0)||(strings==NULL )

◆ if() [8/32]

Aws::if ( (length< 0)||(buffer==NULL )

◆ if() [9/32]

Aws::if ( add_item_to_object(object, name, array, &global_hooks, false)  )

◆ if() [10/32]

Aws::if ( add_item_to_object(object, name, bool_item, &global_hooks, false)  )

◆ if() [11/32]

Aws::if ( add_item_to_object(object, name, false_item, &global_hooks, false)  )

◆ if() [12/32]

Aws::if ( add_item_to_object(object, name, null, &global_hooks, false)  )

◆ if() [13/32]

Aws::if ( add_item_to_object(object, name, number_item, &global_hooks, false)  )

◆ if() [14/32]

Aws::if ( add_item_to_object(object, name, object_item, &global_hooks, false)  )

◆ if() [15/32]

Aws::if ( add_item_to_object(object, name, raw_item, &global_hooks, false)  )

◆ if() [16/32]

Aws::if ( add_item_to_object(object, name, string_item, &global_hooks, false)  )

◆ if() [17/32]

Aws::if ( add_item_to_object(object, name, true_item, &global_hooks, false)  )

◆ if() [18/32]

Aws::if ( after_inserted  = NULL)

◆ if() [19/32]

Aws::if ( copy  = NULL)

◆ if() [20/32]

Aws::if ( item->  valuestring)

◆ if() [21/32]

Aws::if ( item  = NULL)

◆ if() [22/32]

Aws::if ( newitem &&newitem->  child)

◆ if() [23/32]

Aws::if ( NULL  = = value)

◆ if() [24/32]

Aws::if ( object->valuestring = NULL)

◆ if() [25/32]

Aws::if ( parent->  child = item)

◆ if() [26/32]

Aws::if ( )

◆ if() [27/32]

Aws::if ( replacement->next = NULL)

◆ if() [28/32]

Aws::if ( require_null_terminated  )

◆ if() [29/32]

Aws::if ( return_parse_end  )

◆ if() [30/32]

Aws::if ( strlen(valuestring)<=strlen(object->valuestring )

◆ if() [31/32]

Aws::if ( value !  = NULL)

◆ if() [32/32]

Aws::if ( value  = NULL || 0 == buffer_length)

◆ minify_string()

static void Aws::minify_string ( char **  input,
char **  output 
)
static

◆ parse_array()

static cJSON_bool Aws::parse_array ( cJSON *const  item,
parse_buffer *const  input_buffer 
)
static

◆ parse_hex4()

static unsigned Aws::parse_hex4 ( const unsigned char *const  input)
static

◆ parse_number()

static cJSON_bool Aws::parse_number ( cJSON *const  item,
parse_buffer *const  input_buffer 
)
static

◆ parse_object()

static cJSON_bool Aws::parse_object ( cJSON *const  item,
parse_buffer *const  input_buffer 
)
static

◆ parse_string()

static cJSON_bool Aws::parse_string ( cJSON *const  item,
parse_buffer *const  input_buffer 
)
static

◆ parse_value()

static cJSON_bool Aws::parse_value ( cJSON *const  item,
parse_buffer *const  input_buffer 
)
static

◆ print()

static unsigned char * Aws::print ( const cJSON *const  item,
cJSON_bool  format,
const internal_hooks *const  hooks 
)
static

◆ print_array()

static cJSON_bool Aws::print_array ( const cJSON *const  item,
printbuffer *const  output_buffer 
)
static

◆ print_number()

static cJSON_bool Aws::print_number ( const cJSON *const  item,
printbuffer *const  output_buffer 
)
static

◆ print_object()

static cJSON_bool Aws::print_object ( const cJSON *const  item,
printbuffer *const  output_buffer 
)
static

◆ print_string()

static cJSON_bool Aws::print_string ( const cJSON *const  item,
printbuffer *const  p 
)
static

◆ print_string_ptr()

static cJSON_bool Aws::print_string_ptr ( const unsigned char *const  input,
printbuffer *const  output_buffer 
)
static

◆ print_value() [1/2]

static cJSON_bool Aws::print_value ( const cJSON *const  item,
printbuffer *const  output_buffer 
)
static

◆ print_value() [2/2]

return Aws::print_value ( item  ,
p 
)

◆ replace_item_in_object()

static cJSON_bool Aws::replace_item_in_object ( cJSON object,
const char *  string,
cJSON replacement,
cJSON_bool  case_sensitive 
)
static

◆ return()

Aws::return ( char *  )

◆ skip_multiline_comment()

static void Aws::skip_multiline_comment ( char **  input)
static

◆ skip_oneline_comment()

static void Aws::skip_oneline_comment ( char **  input)
static

◆ skip_utf8_bom()

static parse_buffer * Aws::skip_utf8_bom ( parse_buffer *const  buffer)
static

◆ suffix_object()

static void Aws::suffix_object ( cJSON prev,
cJSON item 
)
static

◆ update_offset()

static void Aws::update_offset ( printbuffer *const  buffer)
static

◆ utf16_literal_to_utf8()

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

◆ while()

Aws::while ( child = NULL)

Variable Documentation

◆ __pad0__

fail Aws::__pad0__

◆ __pad1__

fail Aws::__pad1__

◆ a

return Aws::a = NULL

◆ after_inserted

Aws::after_inserted = get_array_item(array, (size_t)which)

◆ b

const cJSON *const Aws::b

◆ boolean

const char *const const cJSON_bool Aws::boolean
Initial value:
{
cJSON *bool_item = cJSON_CreateBool(boolean)
Definition: cJSON.h:122

◆ buffer

p Aws::buffer = (unsigned char*)global_hooks.allocate((size_t)prebuffer)

◆ buffer_length

size_t Aws::buffer_length = strlen(value) + sizeof("")

◆ case_sensitive

const cJSON* const const cJSON_bool Aws::case_sensitive

◆ child

Aws::child = NULL

◆ content

buffer Aws::content = (const unsigned char*)value

◆ copy

return Aws::copy = (char*) cJSON_strdup((const unsigned char*)valuestring, &global_hooks)

◆ count

int Aws::count
Initial value:
{
size_t i = 0

◆ else

Aws::else
Initial value:
{
int cJSON * newitem
Definition: cJSON.h:260
struct cJSON * prev
Definition: cJSON.h:125
struct cJSON * next
Definition: cJSON.h:124

◆ fmt

int cJSON_bool Aws::fmt
Initial value:
{
printbuffer p = { 0, 0, 0, 0, 0, 0, { 0, 0, 0 } }
cJSON * p
Definition: cJSON.cpp:2561
Definition: cJSON.cpp:447

◆ format

p Aws::format = fmt

◆ global_hooks

◆ hooks

p Aws::hooks = global_hooks

◆ index

int Aws::index
Initial value:
{
if (index < 0)
{
return NULL;
}
return get_array_item(array, (size_t)index)
static cJSON * get_array_item(const cJSON *array, size_t index)
Definition: cJSON.cpp:1868
return NULL
Definition: cJSON.cpp:1188
int index
Definition: cJSON.h:188

◆ item

cJSON *const Aws::item = NULL

◆ json

global_error Aws::json = NULL

◆ length

p Aws::length = buffer_length

◆ n

cJSON * Aws::n = NULL

◆ name

const char *const Aws::name
Initial value:
{
cJSON *null = cJSON_CreateNull()

◆ newchild

cJSON* Aws::newchild = NULL

◆ newitem

return Aws::newitem
Initial value:
{
after_inserted
Definition: cJSON.cpp:2289

◆ next

cJSON * Aws::next = NULL

◆ noalloc

p Aws::noalloc = false

◆ NULL

return Aws::NULL

◆ number

const char *const const double Aws::number
Initial value:
{
if (number >= INT_MAX)
{
object->valueint = INT_MAX;
}
else if (number <= (double)INT_MIN)
{
object->valueint = INT_MIN;
}
else
{
object->valueint = (int)number;
}
return object->valuedouble = number
const char *const const double number
Definition: cJSON.h:286

◆ offset

p Aws::offset = 0

◆ p

cJSON * Aws::p = NULL

◆ position

global_error Aws::position = 0

◆ prebuffer

int Aws::prebuffer

◆ prev

a child Aws::prev = after_inserted->prev

◆ raw

const char *const const char *const Aws::raw
Initial value:
{
cJSON *raw_item = cJSON_CreateRaw(raw)
const char *const const char *const raw
Definition: cJSON.h:288

◆ recurse

cJSON_bool Aws::recurse
Initial value:

◆ replacement

cJSON *const cJSON * Aws::replacement
Initial value:
{
if ((parent == NULL) || (replacement == NULL) || (item == NULL))
{
return false;
}
if (replacement == item)
{
return true;
}
cJSON * item
Definition: cJSON.h:240
cJSON *const cJSON * replacement
Definition: cJSON.h:261

◆ require_null_terminated

size_t const char cJSON_bool Aws::require_null_terminated
Initial value:
{
size_t buffer_length
Definition: cJSON.h:167

◆ return_parse_end

size_t const char ** Aws::return_parse_end

◆ string

const char * Aws::string
Initial value:
{
return get_object_item(object, string, false)
static cJSON * get_object_item(const cJSON *const object, const char *const name, const cJSON_bool case_sensitive)
Definition: cJSON.cpp:1897

◆ true

return Aws::true

◆ type

newitem Aws::type = item->type & (~cJSON_IsReference)

◆ valuedouble

newitem Aws::valuedouble = item->valuedouble

◆ valueint

newitem Aws::valueint = item->valueint

◆ valuestring

object Aws::valuestring
Initial value:
{
char *copy = NULL
copy
Definition: cJSON.cpp:432

◆ which

int Aws::which
Initial value:
{
if (which < 0)
{
return NULL;
}
return cJSON_DetachItemViaPointer(array, get_array_item(array, (size_t)which))
return cJSON_DetachItemViaPointer(object, to_detach)
int which
Definition: cJSON.h:252