Classes | Namespaces | Macros | Typedefs | Enumerations | Functions | Variables
sajson.h File Reference
#include <assert.h>
#include <stdint.h>
#include <stddef.h>
#include <string.h>
#include <math.h>
#include <limits.h>
#include <algorithm>
#include <cstdio>
#include <limits>
#include <string>
Include dependency graph for sajson.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  sajson::internal::allocated_buffer
 
class  sajson::bounded_allocation
 
class  sajson::document
 
class  sajson::dynamic_allocation
 
struct  sajson::internal::globals_struct< unused >
 
struct  sajson::internal::allocated_buffer::layout
 
class  sajson::literal
 
class  sajson::mutable_string_view
 
struct  sajson::internal::object_key_comparator
 
struct  sajson::internal::object_key_record
 
class  sajson::internal::ownership
 
class  sajson::single_allocation
 
class  sajson::string
 
class  sajson::value
 

Namespaces

 sajson
 
 sajson::double_storage
 
 sajson::integer_storage
 
 sajson::internal
 

Macros

#define SAJSON_ALWAYS_INLINE   inline
 
#define SAJSON_LIKELY(x)   x
 
#define SAJSON_snprintf   snprintf
 
#define SAJSON_UNLIKELY(x)   x
 
#define SAJSON_UNREACHABLE()   assert(!"unreachable")
 

Typedefs

typedef globals_struct sajson::internal::globals
 

Enumerations

enum  { sajson::integer_storage::word_length = 1 }
 
enum  { sajson::double_storage::word_length = sizeof(double) / sizeof(size_t) }
 
enum  sajson::error {
  sajson::ERROR_NO_ERROR, sajson::ERROR_OUT_OF_MEMORY, sajson::ERROR_UNEXPECTED_END, sajson::ERROR_MISSING_ROOT_ELEMENT,
  sajson::ERROR_BAD_ROOT, sajson::ERROR_EXPECTED_COMMA, sajson::ERROR_MISSING_OBJECT_KEY, sajson::ERROR_EXPECTED_COLON,
  sajson::ERROR_EXPECTED_END_OF_INPUT, sajson::ERROR_UNEXPECTED_COMMA, sajson::ERROR_EXPECTED_VALUE, sajson::ERROR_EXPECTED_NULL,
  sajson::ERROR_EXPECTED_FALSE, sajson::ERROR_EXPECTED_TRUE, sajson::ERROR_INVALID_NUMBER, sajson::ERROR_MISSING_EXPONENT,
  sajson::ERROR_ILLEGAL_CODEPOINT, sajson::ERROR_INVALID_UNICODE_ESCAPE, sajson::ERROR_UNEXPECTED_END_OF_UTF16, sajson::ERROR_EXPECTED_U,
  sajson::ERROR_INVALID_UTF16_TRAIL_SURROGATE, sajson::ERROR_UNKNOWN_ESCAPE, sajson::ERROR_INVALID_UTF8
}
 Error code indicating why parse failed. More...
 
enum  sajson::type : uint8_t {
  sajson::TYPE_INTEGER = 0, sajson::TYPE_DOUBLE = 1, sajson::TYPE_NULL = 2, sajson::TYPE_FALSE = 3,
  sajson::TYPE_TRUE = 4, sajson::TYPE_STRING = 5, sajson::TYPE_ARRAY = 6, sajson::TYPE_OBJECT = 7
}
 Tag indicating a JSON value's type. More...
 

Functions

type sajson::internal::get_element_type (size_t s)
 
size_t sajson::internal::get_element_value (size_t s)
 
const char * sajson::internal::get_error_text (error error_code)
 
bool sajson::internal::is_plain_string_character (char c)
 
bool sajson::internal::is_whitespace (char c)
 
int sajson::integer_storage::load (const size_t *location)
 
double sajson::double_storage::load (const size_t *location)
 
size_t sajson::internal::make_element (type t, size_t value)
 
template<typename AllocationStrategy , typename StringType >
document sajson::parse (const AllocationStrategy &strategy, const StringType &string)
 
void sajson::integer_storage::store (size_t *location, int value)
 
void sajson::double_storage::store (size_t *location, double value)
 

Variables

static const size_t sajson::internal::ROOT_MARKER = VALUE_MASK
 
static const size_t sajson::internal::TYPE_BITS = 3
 
static const size_t sajson::internal::TYPE_MASK = (1 << TYPE_BITS) - 1
 
static const size_t sajson::internal::VALUE_MASK = size_t(-1) >> TYPE_BITS
 

Macro Definition Documentation

◆ SAJSON_ALWAYS_INLINE

#define SAJSON_ALWAYS_INLINE   inline

Definition at line 60 of file sajson.h.

◆ SAJSON_LIKELY

#define SAJSON_LIKELY (   x)    x

Definition at line 58 of file sajson.h.

◆ SAJSON_snprintf

#define SAJSON_snprintf   snprintf

Definition at line 62 of file sajson.h.

◆ SAJSON_UNLIKELY

#define SAJSON_UNLIKELY (   x)    x

Definition at line 59 of file sajson.h.

◆ SAJSON_UNREACHABLE

#define SAJSON_UNREACHABLE ( )    assert(!"unreachable")

Definition at line 61 of file sajson.h.



mvsim
Author(s):
autogenerated on Tue Jul 4 2023 03:08:22