gmsh-TingyuanDoc  0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
picojson.h File Reference
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cstddef>
#include <iostream>
#include <iterator>
#include <limits>
#include <map>
#include <stdexcept>
#include <string>
#include <vector>
#include <utility>
#include <math.h>
#include <locale.h>
Include dependency graph for picojson.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  picojson::null
 
class  picojson::value
 
union  picojson::value::_storage
 
struct  picojson::serialize_str_char< Iter >
 
class  picojson::input< Iter >
 
class  picojson::deny_parse_context
 
class  picojson::default_parse_context
 
class  picojson::null_parse_context
 
struct  picojson::null_parse_context::dummy_str
 
struct  picojson::last_error_t< T >
 

Namespaces

 picojson
 
 std
 

Macros

#define PICOJSON_USE_RVALUE_REFERENCE   0
 
#define PICOJSON_USE_LOCALE   1
 
#define PICOJSON_ASSERT(e)
 
#define SNPRINTF   snprintf
 
#define INIT(p, v)
 
#define DEINIT(p)
 
#define INIT(p, v)
 
#define IS(ctype, jtype)
 
#define GET(ctype, var)
 
#define SET(ctype, jtype, setter)
 
#define MAP(val, sym)
 
#define MAP(sym, val)
 
#define IS(ch, text, op)
 
#define PICOJSON_CMP(type)
 

Typedefs

typedef value::array picojson::array
 
typedef value::object picojson::object
 

Enumerations

enum  {
  picojson::null_type, picojson::boolean_type, picojson::number_type, picojson::string_type,
  picojson::array_type, picojson::object_type
}
 
enum  { picojson::INDENT_WIDTH = 2 }
 

Functions

template<typename Iter >
void picojson::copy (const std::string &s, Iter oi)
 
template<typename Iter >
void picojson::serialize_str (const std::string &s, Iter oi)
 
template<typename Iter >
int picojson::_parse_quadhex (input< Iter > &in)
 
template<typename String , typename Iter >
bool picojson::_parse_codepoint (String &out, input< Iter > &in)
 
template<typename String , typename Iter >
bool picojson::_parse_string (String &out, input< Iter > &in)
 
template<typename Context , typename Iter >
bool picojson::_parse_array (Context &ctx, input< Iter > &in)
 
template<typename Context , typename Iter >
bool picojson::_parse_object (Context &ctx, input< Iter > &in)
 
template<typename Iter >
std::string picojson::_parse_number (input< Iter > &in)
 
template<typename Context , typename Iter >
bool picojson::_parse (Context &ctx, input< Iter > &in)
 
template<typename Iter >
std::string picojson::parse (value &out, Iter &pos, const Iter &last)
 
template<typename Context , typename Iter >
Iter picojson::_parse (Context &ctx, const Iter &first, const Iter &last, std::string *err)
 
template<typename Iter >
Iter picojson::parse (value &out, const Iter &first, const Iter &last, std::string *err)
 
std::string picojson::parse (value &out, const std::string &s)
 
std::string picojson::parse (value &out, std::istream &is)
 
void picojson::set_last_error (const std::string &s)
 
const std::string & picojson::get_last_error ()
 
bool picojson::operator== (const value &x, const value &y)
 
bool picojson::operator!= (const value &x, const value &y)
 
template<>
void std::swap (picojson::value &x, picojson::value &y)
 
std::istream & operator>> (std::istream &is, picojson::value &x)
 
std::ostream & operator<< (std::ostream &os, const picojson::value &x)
 

Macro Definition Documentation

◆ DEINIT

#define DEINIT (   p)
Value:
case p##type: \
delete u_.p; \
break

◆ GET

#define GET (   ctype,
  var 
)
Value:
template <> inline const ctype &value::get<ctype>() const { \
PICOJSON_ASSERT("type mismatch! call is<type>() before get<type>()" && is<ctype>()); \
return var; \
} \
template <> inline ctype &value::get<ctype>() { \
PICOJSON_ASSERT("type mismatch! call is<type>() before get<type>()" && is<ctype>()); \
return var; \
}

Definition at line 358 of file picojson.h.

◆ INIT [1/2]

#define INIT (   p,
 
)
Value:
case p##type: \
u_.p = v; \
break

◆ INIT [2/2]

#define INIT (   p,
 
)
Value:
case p##type: \
u_.p = v; \
break

◆ IS [1/2]

#define IS (   ch,
  text,
  op 
)
Value:
case ch: \
if (in.match(text) && op) { \
return true; \
} else { \
return false; \
}

Definition at line 337 of file picojson.h.

◆ IS [2/2]

#define IS (   ctype,
  jtype 
)
Value:
template <> inline bool value::is<ctype>() const { \
return type_ == jtype##_type; \
}

Definition at line 337 of file picojson.h.

◆ MAP [1/2]

#define MAP (   sym,
  val 
)
Value:
case sym: \
out.push_back(val); \
break

◆ MAP [2/2]

#define MAP (   val,
  sym 
)
Value:
case val: \
copy(sym, oi); \
break

◆ PICOJSON_ASSERT

#define PICOJSON_ASSERT (   e)
Value:
do { \
if (!(e)) \
throw std::runtime_error(#e); \
} while (0)

Definition at line 87 of file picojson.h.

◆ PICOJSON_CMP

#define PICOJSON_CMP (   type)
Value:
if (x.is<type>()) \
return y.is<type>() && x.get<type>() == y.get<type>()

◆ PICOJSON_USE_LOCALE

#define PICOJSON_USE_LOCALE   1

Definition at line 78 of file picojson.h.

◆ PICOJSON_USE_RVALUE_REFERENCE

#define PICOJSON_USE_RVALUE_REFERENCE   0

Definition at line 65 of file picojson.h.

◆ SET

#define SET (   ctype,
  jtype,
  setter 
)
Value:
template <> inline void value::set<ctype>(const ctype &_val) { \
clear(); \
type_ = jtype##_type; \
setter \
}

Definition at line 381 of file picojson.h.

◆ SNPRINTF

#define SNPRINTF   snprintf

Definition at line 101 of file picojson.h.

Function Documentation

◆ operator<<()

std::ostream& operator<< ( std::ostream &  os,
const picojson::value x 
)
inline

Definition at line 1152 of file picojson.h.

Here is the call graph for this function:

◆ operator>>()

std::istream& operator>> ( std::istream &  is,
picojson::value x 
)
inline

Definition at line 1142 of file picojson.h.

Here is the call graph for this function: