text stringlengths 24 1.04M | metadata stringlengths 233 497 |
|---|---|
### File: src/os/win32/ngx_shmem.h
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#ifndef _NGX_SHMEM_H_INCLUDED_
#define _NGX_SHMEM_H_INCLUDED_
#include <ngx_config.h>
#include <ngx_core.h>
typedef struct {
u_char *addr;
size_t size;
ngx_str_t name;
HANDLE ha... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/nginx", "path": "src/os/win32/ngx_shmem.h", "license": "bsd", "size": 599} |
### File: src/os/win32/ngx_socket.c
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#include <ngx_config.h>
#include <ngx_core.h>
int
ngx_nonblocking(ngx_socket_t s)
{
unsigned long nb = 1;
return ioctlsocket(s, FIONBIO, &nb);
}
int
ngx_blocking(ngx_socket_t s)
{
unsigned long nb ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/nginx", "path": "src/os/win32/ngx_socket.c", "license": "bsd", "size": 571} |
### File: src/os/win32/ngx_socket.h
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#ifndef _NGX_SOCKET_H_INCLUDED_
#define _NGX_SOCKET_H_INCLUDED_
#include <ngx_config.h>
#include <ngx_core.h>
#define NGX_WRITE_SHUTDOWN SD_SEND
#define NGX_READ_SHUTDOWN SD_RECEIVE
#define NGX_RDWR_SHUTDOWN SD... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/nginx", "path": "src/os/win32/ngx_socket.h", "license": "bsd", "size": 6080} |
### File: src/os/win32/ngx_stat.c
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#include <ngx_config.h>
#include <ngx_core.h>
int ngx_file_type(char *file, ngx_file_info_t *sb)
{
sb->dwFileAttributes = GetFileAttributes(file);
if (sb->dwFileAttributes == INVALID_FILE_ATTRIBUTES) {
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/nginx", "path": "src/os/win32/ngx_stat.c", "license": "bsd", "size": 493} |
### File: src/os/win32/ngx_thread.c
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#include <ngx_config.h>
#include <ngx_core.h>
ngx_err_t
ngx_create_thread(ngx_tid_t *tid,
ngx_thread_value_t (__stdcall *func)(void *arg), void *arg, ngx_log_t *log)
{
u_long id;
ngx_err_t err;
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/nginx", "path": "src/os/win32/ngx_thread.c", "license": "bsd", "size": 598} |
### File: src/os/win32/ngx_thread.h
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#ifndef _NGX_THREAD_H_INCLUDED_
#define _NGX_THREAD_H_INCLUDED_
#include <ngx_config.h>
#include <ngx_core.h>
typedef HANDLE ngx_tid_t;
typedef DWORD ngx_thread_value_t;
ngx_err_t ngx_create_thread(ngx_tid_t... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/nginx", "path": "src/os/win32/ngx_thread.h", "license": "bsd", "size": 511} |
### File: src/os/win32/ngx_time.c
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#include <ngx_config.h>
#include <ngx_core.h>
void
ngx_gettimeofday(struct timeval *tp)
{
uint64_t intervals;
FILETIME ft;
GetSystemTimeAsFileTime(&ft);
/*
* A file time is a 64-bit value tha... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/nginx", "path": "src/os/win32/ngx_time.c", "license": "bsd", "size": 1504} |
### File: src/os/win32/ngx_time.h
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#ifndef _NGX_TIME_H_INCLUDED_
#define _NGX_TIME_H_INCLUDED_
#include <ngx_config.h>
#include <ngx_core.h>
typedef ngx_rbtree_key_t ngx_msec_t;
typedef ngx_rbtree_key_int_t ngx_msec_int_t;
typedef SYSTEMTIME ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/nginx", "path": "src/os/win32/ngx_time.h", "license": "bsd", "size": 1193} |
### File: src/os/win32/ngx_udp_wsarecv.c
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_event.h>
ssize_t
ngx_udp_wsarecv(ngx_connection_t *c, u_char *buf, size_t size)
{
int rc;
u_long bytes, flags;
WSABUF ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/nginx", "path": "src/os/win32/ngx_udp_wsarecv.c", "license": "bsd", "size": 3706} |
### File: src/os/win32/ngx_user.c
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#include <ngx_config.h>
#include <ngx_core.h>
#if (NGX_CRYPT)
ngx_int_t
ngx_libc_crypt(ngx_pool_t *pool, u_char *key, u_char *salt, u_char **encrypted)
{
/* STUB: a plain text password */
*encrypted = key;
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/nginx", "path": "src/os/win32/ngx_user.c", "license": "bsd", "size": 331} |
### File: src/os/win32/ngx_user.h
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#ifndef _NGX_USER_H_INCLUDED_
#define _NGX_USER_H_INCLUDED_
#include <ngx_config.h>
#include <ngx_core.h>
/* STUB */
#define ngx_uid_t ngx_int_t
#define ngx_gid_t ngx_int_t
ngx_int_t ngx_libc_crypt(ngx_pool_t *... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/nginx", "path": "src/os/win32/ngx_user.h", "license": "bsd", "size": 381} |
### File: src/os/win32/ngx_win32_config.h
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#ifndef _NGX_WIN32_CONFIG_H_INCLUDED_
#define _NGX_WIN32_CONFIG_H_INCLUDED_
#undef WIN32
#define WIN32 0x0400
#define _WIN32_WINNT 0x0501
#define STRICT
#define WIN32_LEAN_AND_MEAN
/* enable gete... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/nginx", "path": "src/os/win32/ngx_win32_config.h", "license": "bsd", "size": 6274} |
### File: src/os/win32/ngx_win32_init.c
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#include <ngx_config.h>
#include <ngx_core.h>
#include <nginx.h>
ngx_uint_t ngx_win32_version;
ngx_uint_t ngx_ncpu;
ngx_uint_t ngx_max_wsabufs;
ngx_int_t ngx_max_sockets;
ngx_uint_t ngx_inherited_nonblock... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/nginx", "path": "src/os/win32/ngx_win32_init.c", "license": "bsd", "size": 9293} |
### File: src/os/win32/ngx_wsarecv.c
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_event.h>
ssize_t
ngx_wsarecv(ngx_connection_t *c, u_char *buf, size_t size)
{
int rc;
u_long bytes, flags;
WSABUF wsa... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/nginx", "path": "src/os/win32/ngx_wsarecv.c", "license": "bsd", "size": 5153} |
### File: src/os/win32/ngx_wsarecv_chain.c
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_event.h>
#define NGX_WSABUFS 64
ssize_t
ngx_wsarecv_chain(ngx_connection_t *c, ngx_chain_t *chain, off_t limit)
{
int rc;
u_ch... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/nginx", "path": "src/os/win32/ngx_wsarecv_chain.c", "license": "bsd", "size": 3265} |
### File: src/os/win32/ngx_wsasend.c
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_event.h>
ssize_t
ngx_wsasend(ngx_connection_t *c, u_char *buf, size_t size)
{
int n;
u_long sent;
ngx_err_t err;
ngx... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/nginx", "path": "src/os/win32/ngx_wsasend.c", "license": "bsd", "size": 4104} |
### File: src/os/win32/ngx_wsasend_chain.c
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_event.h>
#define NGX_WSABUFS 64
ngx_chain_t *
ngx_wsasend_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
{
int rc;
u... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/nginx", "path": "src/os/win32/ngx_wsasend_chain.c", "license": "bsd", "size": 7337} |
### File: src/stream/ngx_stream.c
/*
* Copyright (C) Roman Arutyunyan
* Copyright (C) Nginx, Inc.
*/
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_event.h>
#include <ngx_stream.h>
static char *ngx_stream_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
static ngx_int_t ngx_stream_init_phases... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/nginx", "path": "src/stream/ngx_stream.c", "license": "bsd", "size": 30769} |
### File: src/stream/ngx_stream.h
/*
* Copyright (C) Roman Arutyunyan
* Copyright (C) Nginx, Inc.
*/
#ifndef _NGX_STREAM_H_INCLUDED_
#define _NGX_STREAM_H_INCLUDED_
#include <ngx_config.h>
#include <ngx_core.h>
#if (NGX_STREAM_SSL)
#include <ngx_stream_ssl_module.h>
#endif
typedef struct ngx_stream_session_s... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/nginx", "path": "src/stream/ngx_stream.h", "license": "bsd", "size": 11564} |
### File: src/stream/ngx_stream_access_module.c
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_stream.h>
typedef struct {
in_addr_t mask;
in_addr_t addr;
ngx_uint_t deny; /* unsigned deny:1; */
} ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/nginx", "path": "src/stream/ngx_stream_access_module.c", "license": "bsd", "size": 11621} |
### File: src/stream/ngx_stream_core_module.c
/*
* Copyright (C) Roman Arutyunyan
* Copyright (C) Nginx, Inc.
*/
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_stream.h>
static ngx_uint_t ngx_stream_preread_can_peek(ngx_connection_t *c);
static ngx_int_t ngx_stream_preread_peek(ngx_stream_session_t... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/nginx", "path": "src/stream/ngx_stream_core_module.c", "license": "bsd", "size": 35930} |
### File: src/stream/ngx_stream_geo_module.c
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_stream.h>
typedef struct {
ngx_stream_variable_value_t *value;
u_short start;
u_short ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/nginx", "path": "src/stream/ngx_stream_geo_module.c", "license": "bsd", "size": 42529} |
### File: src/stream/ngx_stream_geoip_module.c
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_stream.h>
#include <GeoIP.h>
#include <GeoIPCity.h>
#define NGX_GEOIP_COUNTRY_CODE 0
#define NGX_GEOIP_COUNTRY_CODE3 1
#define NGX_GEOIP_CO... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/nginx", "path": "src/stream/ngx_stream_geoip_module.c", "license": "bsd", "size": 19745} |
### File: src/stream/ngx_stream_handler.c
/*
* Copyright (C) Roman Arutyunyan
* Copyright (C) Nginx, Inc.
*/
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_event.h>
#include <ngx_stream.h>
static void ngx_stream_log_session(ngx_stream_session_t *s);
static void ngx_stream_close_connection(ngx_conne... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/nginx", "path": "src/stream/ngx_stream_handler.c", "license": "bsd", "size": 9512} |
### File: src/stream/ngx_stream_limit_conn_module.c
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_stream.h>
#define NGX_STREAM_LIMIT_CONN_PASSED 1
#define NGX_STREAM_LIMIT_CONN_REJECTED 2
#define NGX_STREAM_LIMIT_CON... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/nginx", "path": "src/stream/ngx_stream_limit_conn_module.c", "license": "bsd", "size": 20012} |
### File: src/stream/ngx_stream_log_module.c
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_stream.h>
#if (NGX_ZLIB)
#include <zlib.h>
#endif
typedef struct ngx_stream_log_op_s ngx_stream_log_op_t;
typedef u_char *(*ngx_stream_log_op_... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/nginx", "path": "src/stream/ngx_stream_log_module.c", "license": "bsd", "size": 41632} |
### File: src/stream/ngx_stream_map_module.c
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_stream.h>
typedef struct {
ngx_uint_t hash_max_size;
ngx_uint_t hash_bucket_size;
} ngx_stream_map_... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/nginx", "path": "src/stream/ngx_stream_map_module.c", "license": "bsd", "size": 15075} |
### File: src/stream/ngx_stream_pass_module.c
/*
* Copyright (C) Roman Arutyunyan
* Copyright (C) Nginx, Inc.
*/
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_stream.h>
#define NGX_STREAM_PASS_MAX_PASSES 10
typedef struct {
ngx_addr_t *addr;
ngx_stream_complex_value_t ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/nginx", "path": "src/stream/ngx_stream_pass_module.c", "license": "bsd", "size": 8190} |
### File: src/stream/ngx_stream_proxy_module.c
/*
* Copyright (C) Roman Arutyunyan
* Copyright (C) Nginx, Inc.
*/
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_stream.h>
typedef struct {
ngx_addr_t *addr;
ngx_stream_complex_value_t *value;
#if (NGX_HAVE_TRANSPAREN... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/nginx", "path": "src/stream/ngx_stream_proxy_module.c", "license": "bsd", "size": 70576} |
### File: src/stream/ngx_stream_realip_module.c
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_stream.h>
typedef struct {
ngx_array_t *from; /* array of ngx_cidr_t */
} ngx_stream_realip_srv_conf_t;
typedef struct {
s... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/nginx", "path": "src/stream/ngx_stream_realip_module.c", "license": "bsd", "size": 10015} |
### File: src/stream/ngx_stream_return_module.c
/*
* Copyright (C) Roman Arutyunyan
* Copyright (C) Nginx, Inc.
*/
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_stream.h>
typedef struct {
ngx_stream_complex_value_t text;
} ngx_stream_return_srv_conf_t;
typedef struct {
ngx_chain_t ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/nginx", "path": "src/stream/ngx_stream_return_module.c", "license": "bsd", "size": 5692} |
### File: src/stream/ngx_stream_script.c
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_stream.h>
static ngx_int_t ngx_stream_script_init_arrays(
ngx_stream_script_compile_t *sc);
static ngx_int_t ngx_stream_script_done(ngx_stream_sc... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/nginx", "path": "src/stream/ngx_stream_script.c", "license": "bsd", "size": 24663} |
### File: src/stream/ngx_stream_script.h
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#ifndef _NGX_STREAM_SCRIPT_H_INCLUDED_
#define _NGX_STREAM_SCRIPT_H_INCLUDED_
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_stream.h>
typedef struct {
u_char *ip;
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/nginx", "path": "src/stream/ngx_stream_script.h", "license": "bsd", "size": 4238} |
### File: src/stream/ngx_stream_set_module.c
/*
* Copyright (C) Pavel Pautov
* Copyright (C) Nginx, Inc.
*/
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_stream.h>
typedef struct {
ngx_int_t index;
ngx_stream_set_variable_pt set_handler;
uintptr_t d... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/nginx", "path": "src/stream/ngx_stream_set_module.c", "license": "bsd", "size": 5965} |
### File: src/stream/ngx_stream_split_clients_module.c
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_stream.h>
typedef struct {
uint32_t percent;
ngx_stream_variable_value_t value;
} ngx_stream_split_clien... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/nginx", "path": "src/stream/ngx_stream_split_clients_module.c", "license": "bsd", "size": 6576} |
### File: src/stream/ngx_stream_ssl_module.c
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_stream.h>
typedef ngx_int_t (*ngx_ssl_variable_handler_pt)(ngx_connection_t *c,
ngx_pool_t *pool, ngx_str_t *s);
#define NGX_DEFAULT_CIPHER... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/nginx", "path": "src/stream/ngx_stream_ssl_module.c", "license": "bsd", "size": 44910} |
### File: src/stream/ngx_stream_ssl_module.h
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#ifndef _NGX_STREAM_SSL_H_INCLUDED_
#define _NGX_STREAM_SSL_H_INCLUDED_
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_stream.h>
typedef struct {
ngx_msec_t handshake_timeout;
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/nginx", "path": "src/stream/ngx_stream_ssl_module.h", "license": "bsd", "size": 1507} |
### File: src/stream/ngx_stream_ssl_preread_module.c
/*
* Copyright (C) Nginx, Inc.
*/
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_stream.h>
typedef struct {
ngx_flag_t enabled;
} ngx_stream_ssl_preread_srv_conf_t;
typedef struct {
size_t left;
size_t size;
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/nginx", "path": "src/stream/ngx_stream_ssl_preread_module.c", "license": "bsd", "size": 18436} |
### File: src/stream/ngx_stream_upstream.c
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_stream.h>
static ngx_int_t ngx_stream_upstream_add_variables(ngx_conf_t *cf);
static ngx_int_t ngx_stream_upstream_addr_variable(ngx_stream_session... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/nginx", "path": "src/stream/ngx_stream_upstream.c", "license": "bsd", "size": 18218} |
### File: src/stream/ngx_stream_upstream.h
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#ifndef _NGX_STREAM_UPSTREAM_H_INCLUDED_
#define _NGX_STREAM_UPSTREAM_H_INCLUDED_
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_stream.h>
#include <ngx_event_connect.h>
#define NGX_STREAM_UPS... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/nginx", "path": "src/stream/ngx_stream_upstream.h", "license": "bsd", "size": 4948} |
### File: src/stream/ngx_stream_upstream_hash_module.c
/*
* Copyright (C) Roman Arutyunyan
* Copyright (C) Nginx, Inc.
*/
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_stream.h>
typedef struct {
uint32_t hash;
ngx_str_t *server;
} ngx... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/nginx", "path": "src/stream/ngx_stream_upstream_hash_module.c", "license": "bsd", "size": 19003} |
### File: src/stream/ngx_stream_upstream_least_conn_module.c
/*
* Copyright (C) Maxim Dounin
* Copyright (C) Nginx, Inc.
*/
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_stream.h>
static ngx_int_t ngx_stream_upstream_init_least_conn_peer(
ngx_stream_session_t *s, ngx_stream_upstream_srv_conf_t... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/nginx", "path": "src/stream/ngx_stream_upstream_least_conn_module.c", "license": "bsd", "size": 8160} |
### File: src/stream/ngx_stream_upstream_random_module.c
/*
* Copyright (C) Nginx, Inc.
*/
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_stream.h>
typedef struct {
ngx_stream_upstream_rr_peer_t *peer;
ngx_uint_t range;
} ngx_stream_upstream_random_range... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/nginx", "path": "src/stream/ngx_stream_upstream_random_module.c", "license": "bsd", "size": 13046} |
### File: src/stream/ngx_stream_upstream_round_robin.c
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_stream.h>
#define ngx_stream_upstream_tries(p) ((p)->tries \
+ ((p)-... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/nginx", "path": "src/stream/ngx_stream_upstream_round_robin.c", "license": "bsd", "size": 23118} |
### File: src/stream/ngx_stream_upstream_round_robin.h
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#ifndef _NGX_STREAM_UPSTREAM_ROUND_ROBIN_H_INCLUDED_
#define _NGX_STREAM_UPSTREAM_ROUND_ROBIN_H_INCLUDED_
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_stream.h>
typedef struct ng... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/nginx", "path": "src/stream/ngx_stream_upstream_round_robin.h", "license": "bsd", "size": 4958} |
### File: src/stream/ngx_stream_upstream_zone_module.c
/*
* Copyright (C) Ruslan Ermilov
* Copyright (C) Nginx, Inc.
*/
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_stream.h>
static char *ngx_stream_upstream_zone(ngx_conf_t *cf, ngx_command_t *cmd,
void *conf);
static ngx_int_t ngx_stream_ups... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/nginx", "path": "src/stream/ngx_stream_upstream_zone_module.c", "license": "bsd", "size": 8598} |
### File: src/stream/ngx_stream_variables.c
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_stream.h>
#include <nginx.h>
static ngx_stream_variable_t *ngx_stream_add_prefix_variable(ngx_conf_t *cf,
ngx_str_t *name, ngx_uint_t flags);
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/nginx", "path": "src/stream/ngx_stream_variables.c", "license": "bsd", "size": 32915} |
### File: src/stream/ngx_stream_variables.h
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#ifndef _NGX_STREAM_VARIABLES_H_INCLUDED_
#define _NGX_STREAM_VARIABLES_H_INCLUDED_
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_stream.h>
typedef ngx_variable_value_t ngx_stream_variable_... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/nginx", "path": "src/stream/ngx_stream_variables.h", "license": "bsd", "size": 3163} |
### File: src/stream/ngx_stream_write_filter_module.c
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_stream.h>
typedef struct {
ngx_chain_t *from_upstream;
ngx_chain_t *from_downstream;
} ngx_stream_write_filter_ctx_t;
static... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/nginx", "path": "src/stream/ngx_stream_write_filter_module.c", "license": "bsd", "size": 9017} |
### File: .reuse/templates/json.jinja2
__ _____ _____ _____
__| | __| | | | JSON for Modern C++
| | |__ | | | | | | version 3.11.3
|_____|_____|_____|_|___| https://github.com/nlohmann/json
{% for copyright_line in copyright_lines %}
{{ copyright_line }}
{% endfor %}
{% for expression in spdx_ex... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Jinja", "repo_name": "minhanghuang/nlohmann_json", "path": ".reuse/templates/json.jinja2", "license": "mit", "size": 349} |
### File: .reuse/templates/json_support.jinja2
__ _____ _____ _____
__| | __| | | | JSON for Modern C++ (supporting code)
| | |__ | | | | | | version 3.11.3
|_____|_____|_____|_|___| https://github.com/nlohmann/json
{% for copyright_line in copyright_lines %}
{{ copyright_line }}
{% endfor %}
{%... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Jinja", "repo_name": "minhanghuang/nlohmann_json", "path": ".reuse/templates/json_support.jinja2", "license": "mit", "size": 367} |
### File: BUILD.bazel
cc_library(
name = "json",
hdrs = [
"include/nlohmann/adl_serializer.hpp",
"include/nlohmann/byte_container_with_subtype.hpp",
"include/nlohmann/detail/abi_macros.hpp",
"include/nlohmann/detail/conversions/from_json.hpp",
"include/nlohmann/detail/con... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Starlark", "repo_name": "minhanghuang/nlohmann_json", "path": "BUILD.bazel", "license": "mit", "size": 2634} |
### File: CMakeLists.txt
cmake_minimum_required(VERSION 3.1...3.14)
##
## PROJECT
## name and version
##
project(nlohmann_json VERSION 3.11.3 LANGUAGES CXX)
##
## MAIN_PROJECT CHECK
## determine if nlohmann_json is built as a subproject (using add_subdirectory) or if it is the main project
##
set(MAIN_PROJECT OFF)
if... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CMake", "repo_name": "minhanghuang/nlohmann_json", "path": "CMakeLists.txt", "license": "mit", "size": 7180} |
### File: Makefile
.PHONY: pretty clean ChangeLog.md release
##########################################################################
# configuration
##########################################################################
# find GNU sed to use `-i` parameter
SED:=$(shell command -v gsed || which sed)
#########... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Makefile", "repo_name": "minhanghuang/nlohmann_json", "path": "Makefile", "license": "mit", "size": 13461} |
### File: Package.swift
// swift-tools-version: 5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "nlohmann-json",
platforms: [
.iOS(.v12), .macOS(.v10_13), .tvOS(.v12), .watchOS(.v4)
],
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Swift", "repo_name": "minhanghuang/nlohmann_json", "path": "Package.swift", "license": "mit", "size": 554} |
### File: WORKSPACE.bazel
workspace(name = "nlohmann_json")
| {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Starlark", "repo_name": "minhanghuang/nlohmann_json", "path": "WORKSPACE.bazel", "license": "mit", "size": 34} |
### File: cmake/ci.cmake
# number of parallel jobs for CTest
set(N 10)
###############################################################################
# Needed tools.
###############################################################################
include(FindPython3)
find_package(Python3 COMPONENTS Interpreter)
find... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CMake", "repo_name": "minhanghuang/nlohmann_json", "path": "cmake/ci.cmake", "license": "mit", "size": 45381} |
### File: cmake/config.cmake.in
include(FindPackageHandleStandardArgs)
set(${CMAKE_FIND_PACKAGE_NAME}_CONFIG ${CMAKE_CURRENT_LIST_FILE})
find_package_handle_standard_args(@PROJECT_NAME@ CONFIG_MODE)
if(NOT TARGET @PROJECT_NAME@::@NLOHMANN_JSON_TARGET_NAME@)
include("${CMAKE_CURRENT_LIST_DIR}/@NLOHMANN_JSON_TARGETS... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CMake", "repo_name": "minhanghuang/nlohmann_json", "path": "cmake/config.cmake.in", "license": "mit", "size": 710} |
### File: cmake/download_test_data.cmake
set(JSON_TEST_DATA_URL https://github.com/nlohmann/json_test_data)
set(JSON_TEST_DATA_VERSION 3.1.0)
# if variable is set, use test data from given directory rather than downloading them
if(JSON_TestDataDirectory)
message(STATUS "Using test data in ${JSON_TestDataDirect... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CMake", "repo_name": "minhanghuang/nlohmann_json", "path": "cmake/download_test_data.cmake", "license": "mit", "size": 3185} |
### File: cmake/nlohmann_jsonConfigVersion.cmake.in
# This is essentially cmake's BasicConfigVersion-SameMajorVersion.cmake.in but
# without the 32/64-bit check. Since json is a header-only library, it doesn't
# matter if it was built on a different platform than what it is used on (see
# https://github.com/nlohmann/j... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CMake", "repo_name": "minhanghuang/nlohmann_json", "path": "cmake/nlohmann_jsonConfigVersion.cmake.in", "license": "mit", "size": 709} |
### File: cmake/scripts/gen_bazel_build_file.cmake
# generate Bazel BUILD file
set(PROJECT_ROOT "${CMAKE_CURRENT_LIST_DIR}/../..")
set(BUILD_FILE "${PROJECT_ROOT}/BUILD.bazel")
file(GLOB_RECURSE HEADERS LIST_DIRECTORIES false RELATIVE "${PROJECT_ROOT}" "include/*.hpp")
file(WRITE "${BUILD_FILE}" [=[
cc_library(
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CMake", "repo_name": "minhanghuang/nlohmann_json", "path": "cmake/scripts/gen_bazel_build_file.cmake", "license": "mit", "size": 543} |
### File: cmake/test.cmake
set(_json_test_cmake_list_file ${CMAKE_CURRENT_LIST_FILE})
#############################################################################
# download test data
#############################################################################
include(download_test_data)
# test fixture to download... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CMake", "repo_name": "minhanghuang/nlohmann_json", "path": "cmake/test.cmake", "license": "mit", "size": 10468} |
### File: docs/Makefile
SRCDIR = ../single_include
all: create_output
##########################################################################
# example files
##########################################################################
# where are the example cpp files
EXAMPLES = $(wildcard examples/*.cpp)
cxx_stan... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Makefile", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/Makefile", "license": "mit", "size": 1537} |
### File: docs/docset/Makefile
SHELL=/usr/bin/env bash
SED ?= $(shell which gsed 2>/dev/null || which sed)
MKDOCS_PAGES=$(shell cd ../mkdocs/docs/ && find * -type f -name '*.md' | sort)
.PHONY: all
all: JSON_for_Modern_C++.tgz
docSet.dsidx: docSet.sql
# generate index
sqlite3 docSet.dsidx <docSet.sql
JSON_for_Mod... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Makefile", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/docset/Makefile", "license": "mit", "size": 3632} |
### File: docs/examples/README.cpp
#include <iostream>
#include <iomanip>
#include <nlohmann/json.hpp>
using json = nlohmann::json;
int main()
{
// create a JSON object
json j =
{
{"pi", 3.141},
{"happy", true},
{"name", "Niels"},
{"nothing", nullptr},
{
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/README.cpp", "license": "mit", "size": 753} |
### File: docs/examples/accept__string.cpp
#include <iostream>
#include <iomanip>
#include <nlohmann/json.hpp>
using json = nlohmann::json;
int main()
{
// a valid JSON text
auto valid_text = R"(
{
"numbers": [1, 2, 3]
}
)";
// an invalid JSON text
auto invalid_text = R"(
{
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/accept__string.cpp", "license": "mit", "size": 466} |
### File: docs/examples/array.cpp
#include <iostream>
#include <nlohmann/json.hpp>
using json = nlohmann::json;
int main()
{
// create JSON arrays
json j_no_init_list = json::array();
json j_empty_init_list = json::array({});
json j_nonempty_init_list = json::array({1, 2, 3, 4});
json j_list_of_pa... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/array.cpp", "license": "mit", "size": 543} |
### File: docs/examples/array_t.cpp
#include <iostream>
#include <iomanip>
#include <nlohmann/json.hpp>
using json = nlohmann::json;
int main()
{
std::cout << std::boolalpha << std::is_same<std::vector<json>, json::array_t>::value << std::endl;
}
| {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/array_t.cpp", "license": "mit", "size": 217} |
### File: docs/examples/at__json_pointer.cpp
#include <iostream>
#include <nlohmann/json.hpp>
using json = nlohmann::json;
using namespace nlohmann::literals;
int main()
{
// create a JSON value
json j =
{
{"number", 1}, {"string", "foo"}, {"array", {1, 2}}
};
// read-only access
// ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/at__json_pointer.cpp", "license": "mit", "size": 2506} |
### File: docs/examples/at__json_pointer_const.cpp
#include <iostream>
#include <nlohmann/json.hpp>
using json = nlohmann::json;
using namespace nlohmann::literals;
int main()
{
// create a JSON value
const json j =
{
{"number", 1}, {"string", "foo"}, {"array", {1, 2}}
};
// read-only acc... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/at__json_pointer_const.cpp", "license": "mit", "size": 1982} |
### File: docs/examples/at__keytype.c++17.cpp
#include <iostream>
#include <string_view>
#include <nlohmann/json.hpp>
using namespace std::string_view_literals;
using json = nlohmann::json;
int main()
{
// create JSON object
json object =
{
{"the good", "il buono"},
{"the bad", "il cattivo... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/at__keytype.c++17.cpp", "license": "mit", "size": 1138} |
### File: docs/examples/at__keytype_const.c++17.cpp
#include <iostream>
#include <string_view>
#include <nlohmann/json.hpp>
using namespace std::string_view_literals;
using json = nlohmann::json;
int main()
{
// create JSON object
const json object =
{
{"the good", "il buono"},
{"the bad",... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/at__keytype_const.c++17.cpp", "license": "mit", "size": 998} |
### File: docs/examples/at__object_t_key_type.cpp
#include <iostream>
#include <nlohmann/json.hpp>
using json = nlohmann::json;
int main()
{
// create JSON object
json object =
{
{"the good", "il buono"},
{"the bad", "il cattivo"},
{"the ugly", "il brutto"}
};
// output el... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/at__object_t_key_type.cpp", "license": "mit", "size": 993} |
### File: docs/examples/at__object_t_key_type_const.cpp
#include <iostream>
#include <nlohmann/json.hpp>
using json = nlohmann::json;
int main()
{
// create JSON object
const json object =
{
{"the good", "il buono"},
{"the bad", "il cattivo"},
{"the ugly", "il brutto"}
};
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/at__object_t_key_type_const.cpp", "license": "mit", "size": 873} |
### File: docs/examples/at__size_type.cpp
#include <iostream>
#include <nlohmann/json.hpp>
using json = nlohmann::json;
int main()
{
// create JSON array
json array = {"first", "2nd", "third", "fourth"};
// output element at index 2 (third element)
std::cout << array.at(2) << '\n';
// change ele... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/at__size_type.cpp", "license": "mit", "size": 894} |
### File: docs/examples/at__size_type_const.cpp
#include <iostream>
#include <nlohmann/json.hpp>
using json = nlohmann::json;
int main()
{
// create JSON array
const json array = {"first", "2nd", "third", "fourth"};
// output element at index 2 (third element)
std::cout << array.at(2) << '\n';
/... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/at__size_type_const.cpp", "license": "mit", "size": 766} |
### File: docs/examples/back.cpp
#include <iostream>
#include <nlohmann/json.hpp>
using json = nlohmann::json;
int main()
{
// create JSON values
json j_boolean = true;
json j_number_integer = 17;
json j_number_float = 23.42;
json j_object = {{"one", 1}, {"two", 2}};
json j_object_empty(json::... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/back.cpp", "license": "mit", "size": 1055} |
### File: docs/examples/basic_json__CompatibleType.cpp
#include <iostream>
#include <deque>
#include <list>
#include <forward_list>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <valarray>
#include <nlohmann/json.hpp>
using json = nlohmann::json;
int main()
{
// ============
// obj... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/basic_json__CompatibleType.cpp", "license": "mit", "size": 6448} |
### File: docs/examples/basic_json__InputIt_InputIt.cpp
#include <iostream>
#include <nlohmann/json.hpp>
using json = nlohmann::json;
int main()
{
// create JSON values
json j_array = {"alpha", "bravo", "charly", "delta", "easy"};
json j_number = 42;
json j_object = {{"one", "eins"}, {"two", "zwei"}};... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/basic_json__InputIt_InputIt.cpp", "license": "mit", "size": 854} |
### File: docs/examples/basic_json__basic_json.cpp
#include <iostream>
#include <nlohmann/json.hpp>
using json = nlohmann::json;
int main()
{
// create a JSON array
json j1 = {"one", "two", 3, 4.5, false};
// create a copy
json j2(j1);
// serialize the JSON array
std::cout << j1 << " = " << ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/basic_json__basic_json.cpp", "license": "mit", "size": 338} |
### File: docs/examples/basic_json__copyassignment.cpp
#include <iostream>
#include <nlohmann/json.hpp>
using json = nlohmann::json;
int main()
{
// create JSON values
json a = 23;
json b = 42;
// copy-assign a to b
b = a;
// serialize the JSON arrays
std::cout << a << '\n';
std::cou... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/basic_json__copyassignment.cpp", "license": "mit", "size": 283} |
### File: docs/examples/basic_json__list_init_t.cpp
#include <iostream>
#include <nlohmann/json.hpp>
using json = nlohmann::json;
int main()
{
// create JSON values
json j_empty_init_list = json({});
json j_object = { {"one", 1}, {"two", 2} };
json j_array = {1, 2, 3, 4};
json j_nested_object = { ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/basic_json__list_init_t.cpp", "license": "mit", "size": 593} |
### File: docs/examples/basic_json__moveconstructor.cpp
#include <iostream>
#include <nlohmann/json.hpp>
using json = nlohmann::json;
int main()
{
// create a JSON value
json a = 23;
// move contents of a to b
json b(std::move(a));
// serialize the JSON arrays
std::cout << a << '\n';
std... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/basic_json__moveconstructor.cpp", "license": "mit", "size": 287} |
### File: docs/examples/basic_json__nullptr_t.cpp
#include <iostream>
#include <nlohmann/json.hpp>
using json = nlohmann::json;
int main()
{
// implicitly create a JSON null value
json j1;
// explicitly create a JSON null value
json j2(nullptr);
// serialize the JSON null value
std::cout << ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/basic_json__nullptr_t.cpp", "license": "mit", "size": 298} |
### File: docs/examples/basic_json__size_type_basic_json.cpp
#include <iostream>
#include <nlohmann/json.hpp>
using json = nlohmann::json;
int main()
{
// create an array by creating copies of a JSON value
json value = "Hello";
json array_0 = json(0, value);
json array_1 = json(1, value);
json arr... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/basic_json__size_type_basic_json.cpp", "license": "mit", "size": 420} |
### File: docs/examples/basic_json__value_t.cpp
#include <iostream>
#include <nlohmann/json.hpp>
using json = nlohmann::json;
int main()
{
// create the different JSON values with default values
json j_null(json::value_t::null);
json j_boolean(json::value_t::boolean);
json j_number_integer(json::value... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/basic_json__value_t.cpp", "license": "mit", "size": 764} |
### File: docs/examples/begin.cpp
#include <iostream>
#include <nlohmann/json.hpp>
using json = nlohmann::json;
int main()
{
// create an array value
json array = {1, 2, 3, 4, 5};
// get an iterator to the first element
json::iterator it = array.begin();
// serialize the element that the iterato... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/begin.cpp", "license": "mit", "size": 330} |
### File: docs/examples/binary.cpp
#include <iostream>
#include <nlohmann/json.hpp>
using json = nlohmann::json;
int main()
{
// create a binary vector
std::vector<std::uint8_t> vec = {0xCA, 0xFE, 0xBA, 0xBE};
// create a binary JSON value with subtype 42
json j = json::binary(vec, 42);
// outpu... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/binary.cpp", "license": "mit", "size": 408} |
### File: docs/examples/binary_t.cpp
#include <iostream>
#include <iomanip>
#include <nlohmann/json.hpp>
using json = nlohmann::json;
int main()
{
std::cout << std::boolalpha << std::is_same<nlohmann::byte_container_with_subtype<std::vector<std::uint8_t>>, json::binary_t>::value << std::endl;
}
| {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/binary_t.cpp", "license": "mit", "size": 265} |
### File: docs/examples/boolean_t.cpp
#include <iostream>
#include <iomanip>
#include <nlohmann/json.hpp>
using json = nlohmann::json;
int main()
{
std::cout << std::boolalpha << std::is_same<bool, json::boolean_t>::value << std::endl;
}
| {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/boolean_t.cpp", "license": "mit", "size": 206} |
### File: docs/examples/byte_container_with_subtype__byte_container_with_subtype.cpp
#include <iostream>
#include <nlohmann/json.hpp>
// define a byte container based on std::vector
using byte_container_with_subtype = nlohmann::byte_container_with_subtype<std::vector<std::uint8_t>>;
using json = nlohmann::json;
int ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/byte_container_with_subtype__byte_container_with_subtype.cpp", "license": "mit", "size": 648} |
### File: docs/examples/byte_container_with_subtype__clear_subtype.cpp
#include <iostream>
#include <nlohmann/json.hpp>
// define a byte container based on std::vector
using byte_container_with_subtype = nlohmann::byte_container_with_subtype<std::vector<std::uint8_t>>;
using json = nlohmann::json;
int main()
{
s... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/byte_container_with_subtype__clear_subtype.cpp", "license": "mit", "size": 576} |
### File: docs/examples/byte_container_with_subtype__has_subtype.cpp
#include <iostream>
#include <nlohmann/json.hpp>
// define a byte container based on std::vector
using byte_container_with_subtype = nlohmann::byte_container_with_subtype<std::vector<std::uint8_t>>;
int main()
{
std::vector<std::uint8_t> bytes =... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/byte_container_with_subtype__has_subtype.cpp", "license": "mit", "size": 602} |
### File: docs/examples/byte_container_with_subtype__set_subtype.cpp
#include <iostream>
#include <nlohmann/json.hpp>
// define a byte container based on std::vector
using byte_container_with_subtype = nlohmann::byte_container_with_subtype<std::vector<std::uint8_t>>;
using json = nlohmann::json;
int main()
{
std... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/byte_container_with_subtype__set_subtype.cpp", "license": "mit", "size": 594} |
### File: docs/examples/byte_container_with_subtype__subtype.cpp
#include <iostream>
#include <nlohmann/json.hpp>
// define a byte container based on std::vector
using byte_container_with_subtype = nlohmann::byte_container_with_subtype<std::vector<std::uint8_t>>;
int main()
{
std::vector<std::uint8_t> bytes = {{0... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/byte_container_with_subtype__subtype.cpp", "license": "mit", "size": 712} |
### File: docs/examples/cbegin.cpp
#include <iostream>
#include <nlohmann/json.hpp>
using json = nlohmann::json;
int main()
{
// create an array value
const json array = {1, 2, 3, 4, 5};
// get an iterator to the first element
json::const_iterator it = array.cbegin();
// serialize the element th... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/cbegin.cpp", "license": "mit", "size": 343} |
### File: docs/examples/cbor_tag_handler_t.cpp
#include <iostream>
#include <nlohmann/json.hpp>
using json = nlohmann::json;
int main()
{
// tagged byte string
std::vector<std::uint8_t> vec = {{0xd8, 0x42, 0x44, 0xcA, 0xfe, 0xba, 0xbe}};
// cbor_tag_handler_t::error throws
try
{
auto b_th... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/cbor_tag_handler_t.cpp", "license": "mit", "size": 843} |
### File: docs/examples/cend.cpp
#include <iostream>
#include <nlohmann/json.hpp>
using json = nlohmann::json;
int main()
{
// create an array value
json array = {1, 2, 3, 4, 5};
// get an iterator to one past the last element
json::const_iterator it = array.cend();
// decrement the iterator to ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/cend.cpp", "license": "mit", "size": 413} |
### File: docs/examples/clear.cpp
#include <iostream>
#include <nlohmann/json.hpp>
using json = nlohmann::json;
int main()
{
// create JSON values
json j_null;
json j_boolean = true;
json j_number_integer = 17;
json j_number_float = 23.42;
json j_object = {{"one", 1}, {"two", 2}};
json j_a... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/clear.cpp", "license": "mit", "size": 832} |
### File: docs/examples/contains__json_pointer.cpp
#include <iostream>
#include <nlohmann/json.hpp>
using json = nlohmann::json;
using namespace nlohmann::literals;
int main()
{
// create a JSON value
json j =
{
{"number", 1}, {"string", "foo"}, {"array", {1, 2}}
};
std::cout << std::bool... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/contains__json_pointer.cpp", "license": "mit", "size": 1129} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.