Пример #1
0
//----------------------------------------------------------------//
void MOAIHarness::ReceiveBreakClear(lua_State *L, json_t* node)
{
	// Get the breakpoint data.
	json_t* np_file = json_object_get(node, "FileName");
	if (np_file == NULL || json_typeof(np_file) != JSON_STRING)
		return;
	json_t* np_line = json_object_get(node, "LineNumber");
	if (np_line == NULL || json_typeof(np_line) != JSON_INTEGER)
		return;

	// Store breakpoint data.
	const char* file = json_string_value(np_file);
	int line = ( int )json_integer_value(np_line);

	// Find and remove the breakpoint
	int identifier = MOAIHarness::mPathDictionary.GetIdentifier(file);
	for (std::vector<MOAIBreakpoint>::const_iterator i = MOAIHarness::mBreakpoints.begin(); i < MOAIHarness::mBreakpoints.end(); i++)
	{
		if ((*i).identifier == identifier && (*i).line == line)
		{
			MOAIHarness::mBreakpoints.erase(i);
			break;
		}
	}

}
Пример #2
0
int json_equal(json_t *json1, json_t *json2)
{
    if(!json1 || !json2)
        return 0;

    if(json_typeof(json1) != json_typeof(json2))
        return 0;

    /* this covers true, false and null as they are singletons */
    if(json1 == json2)
        return 1;

    if(json_is_object(json1))
        return json_object_equal(json1, json2);

    if(json_is_array(json1))
        return json_array_equal(json1, json2);

    if(json_is_string(json1))
        return json_string_equal(json1, json2);

    if(json_is_integer(json1))
        return json_integer_equal(json1, json2);

    if(json_is_real(json1))
        return json_real_equal(json1, json2);

    return 0;
}
Пример #3
0
void
acl_read_commands(json_t *jlist, struct acl_commands *ac) {

	unsigned int i, n, cur;

	/* count strings in the array */
	for(i = 0, n = 0; i < json_array_size(jlist); ++i) {
		json_t *jelem = json_array_get(jlist, (size_t)i);
		if(json_typeof(jelem) == JSON_STRING) {
			n++;
		}
	}

	/* allocate block */
	ac->commands = calloc((size_t)n, sizeof(char*));
	ac->count = n;

	/* add all disabled commands */
	for(i = 0, cur = 0; i < json_array_size(jlist); ++i) {
		json_t *jelem = json_array_get(jlist, i);
		if(json_typeof(jelem) == JSON_STRING) {
			size_t sz;
			const char *s = json_string_value(jelem);
			sz = strlen(s);

			ac->commands[cur] = calloc(1 + sz, 1);
			memcpy(ac->commands[cur], s, sz);
			cur++;
		}
	}
}
Пример #4
0
//check that val is of the given type
static json_t* expect (json_t* val, json_type expected_type) {
  if (loadError || val == NULL || (json_typeof(val) != expected_type)) {
    if (val != NULL)
      LOGE("val type(%s) != expected_type(%s)", type2str(json_typeof(val)), type2str(expected_type));
    else
      LOGE("val = NULL");
    loadError = true;
  }
  return val;
}
Пример #5
0
static bool json_bool_value(json_t* val) {
  if (json_typeof(val) == JSON_TRUE)
    return true;
  if (json_typeof(val) == JSON_FALSE)
    return false;
  if (json_typeof(val) == JSON_INTEGER)
    return json_integer_value(val) != 0;
  LOGE("json_bool_value : not bool (%i)", json_typeof(val));
  loadError=true;
  return false;
}
Пример #6
0
    boost::any configuration_parser::convert_json(json_t* _val) {
        switch( json_typeof( _val )) {
            case JSON_INTEGER:
            return boost::any((int)json_integer_value(_val));

            case JSON_STRING:
            return boost::any(std::string(json_string_value(_val)));

            case JSON_REAL:
            return boost::any(json_real_value(_val));

            case JSON_TRUE:
            return boost::any(json_true());
            
            case JSON_FALSE:
            return boost::any(json_false());

            case JSON_NULL:
            return boost::any(std::string("NULL"));

            case JSON_ARRAY:
            {
                std::vector<boost::any> vector;
                size_t  idx = 0;
                json_t* element = NULL;
                json_array_foreach(_val, idx, element) {
                    try {
                        vector.push_back(convert_json(element));
                    } catch (const irods::exception& e) {
                        irods::log(e);
                    }
                }
                return boost::any(vector);
            }

            case JSON_OBJECT:
            {
                std::unordered_map<std::string, boost::any> map;
                const char* key = NULL;
                json_t*     subval = NULL;
                json_object_foreach( _val, key, subval ) {
                    try {
                        map.insert(std::pair<std::string, boost::any>(std::string(key), convert_json(subval)));
                    } catch (const irods::exception& e) {
                        irods::log(e);
                    }
                }
                return boost::any(map);
            }
        }
        THROW( -1, (boost::format("unhandled type in json_typeof: %d") % json_typeof(_val) ).str());

    } // parse_json_object
Пример #7
0
/*=========================================================================*\
      Get String object from repository 
         Returns NULL on error or if key is not found
         String reference is only good until the key or repository changes!
         So you might copy it for longer usage. 
\*=========================================================================*/
const char *persistGetString( const char *key )
{
  json_t *jObj;
    
/*------------------------------------------------------------------------*\
    Get Object
\*------------------------------------------------------------------------*/
  jObj = persistGetJSON( key );
  if( !jObj ) {
  	DBGMSG( "persistGetString: (%s) not set", key );
    return NULL;  
  }


/*------------------------------------------------------------------------*\
    Check type
\*------------------------------------------------------------------------*/
  if( !json_is_string(jObj) ) {
     logwarn( "Value for key \"%s\" is not a string (%d): ", 
                          key, json_typeof(jObj) );
     return NULL;
  }  

/*------------------------------------------------------------------------*\
    return string value as reference
\*------------------------------------------------------------------------*/
  const char *value = json_string_value( jObj );
  DBGMSG( "persistGetString: (%s)=\"%s\"", key, value?value:"(null)" );
  return value;
}
Пример #8
0
int w_bser_dump(json_t *json, json_dump_callback_t dump, void *data)
{
    int type = json_typeof(json);

    switch (type) {
    case JSON_NULL:
        return dump(&bser_null, sizeof(bser_null), data);
    case JSON_TRUE:
        return dump(&bser_true, sizeof(bser_true), data);
    case JSON_FALSE:
        return dump(&bser_false, sizeof(bser_false), data);
    case JSON_REAL:
        return bser_real(json_real_value(json), dump, data);
    case JSON_INTEGER:
        return bser_int(json_integer_value(json), dump, data);
    case JSON_STRING:
        return bser_string(json_string_value(json), dump, data);
    case JSON_ARRAY:
        return bser_array(json, dump, data);
    case JSON_OBJECT:
        return bser_object(json, dump, data);
    default:
        return -1;
    }
}
Пример #9
0
int w_bser_dump(const bser_ctx_t* ctx, json_t *json, void *data)
{
  int type = json_typeof(json);

  if (!is_bser_version_supported(ctx)) {
    return -1;
  }

  switch (type) {
    case JSON_NULL:
      return ctx->dump(&bser_null, sizeof(bser_null), data);
    case JSON_TRUE:
      return ctx->dump(&bser_true, sizeof(bser_true), data);
    case JSON_FALSE:
      return ctx->dump(&bser_false, sizeof(bser_false), data);
    case JSON_REAL:
      return bser_real(ctx, json_real_value(json), data);
    case JSON_INTEGER:
      return bser_int(ctx, json_integer_value(json), data);
    case JSON_STRING:
      return bser_bytestring(ctx, json_string_value(json), data);
    case JSON_ARRAY:
      return bser_array(ctx, json, data);
    case JSON_OBJECT:
      return bser_object(ctx, json, data);
    default:
      return -1;
  }
}
Пример #10
0
// gets a json value from a key
int json_object_get_object(json_t *object, char *key, json_t **value)
{
  int exit_code = 0;

  check_not_null(object);
  check_not_null(key);
  check_not_null(value);

  json_t *json_object_peek = json_object_get(object, key);
  if (json_object_peek == NULL)
  {
    *value = NULL;
    goto cleanup;
  }

  int json_typeof_result = json_typeof(json_object_peek);
  if (json_typeof_result != JSON_OBJECT)
  {
    *value = NULL;
    goto cleanup;
  }

  *value = json_object_peek;

  goto cleanup;

error:

  exit_code = -1;

cleanup:

  return exit_code;
}
Пример #11
0
/*=========================================================================*\
      Get boolean value from repository 
         return false on error of if key is not found
\*=========================================================================*/
bool persistGetBool( const char *key )
{
  json_t *jObj;

  DBGMSG( "persistGetBool: (%s)", key ); 
    
/*------------------------------------------------------------------------*\
    Get Object
\*------------------------------------------------------------------------*/
  jObj = persistGetJSON( key );
  if( !jObj ) {
  	DBGMSG( "persistGetBool: (%s) not set", key );
    return false;  
  }
  
/*------------------------------------------------------------------------*\
    Check type
\*------------------------------------------------------------------------*/
  if( !json_is_true(jObj) && !json_is_false(jObj) ) {
     logwarn( "Value for key \"%s\" is not a boolean (%d): ", 
                          key, json_typeof(jObj) );
     return false;
  }  

/*------------------------------------------------------------------------*\
    return real value 
\*------------------------------------------------------------------------*/
  bool value = json_is_true( jObj );
  DBGMSG( "persistGetBool: (%s)=%s", key, value?"True":"False" ); 
  return value;
}
Пример #12
0
json_t* extract(json_t* json, char* key)
{
    int i, s;
    json_t* temp;
    switch (json_typeof(json))
    {
        case JSON_OBJECT:
            temp = json_object_get(json, key);
            if (temp == NULL)
                {break;}
            return temp;
        case JSON_ARRAY:
            s = json_array_size(json);
            if (s == 0)
                {break;}
            i = estrtol(key);
            return json_array_get(json, i % s);
        case JSON_STRING:
        case JSON_INTEGER:
        case JSON_REAL:
        case JSON_TRUE:
        case JSON_FALSE:
        case JSON_NULL:
        default:
            break;
    }
    json_err("has no elements to extract", json);
    return json_null();
}
Пример #13
0
/** 
 * Parse the exception information which is presented in JSON
 * 
 * @param content   Exception information in JSON
 * @return          jsonException for printing out
 */
static struct jsonException *parseException(const char *content)
{
    json_error_t error;
    size_t flags = 0;
    const char *key = NULL;
    json_t *value;
    json_t *jobj;
    struct jsonException *exception = NULL;
    
    if (!content) {
        return NULL;
    }
    jobj = json_loads(content, flags, &error);
    if (!jobj) {
        fprintf(stderr, "JSon parsing error: on line %d: %s\n",
                error.line, error.text);
        return NULL;
    }
    void *iter = json_object_iter(jobj);
    while(iter)  {
        key = json_object_iter_key(iter);
        value = json_object_iter_value(iter);
        
        if (!strcmp(key, "RemoteException") &&
                    json_typeof(value) == JSON_OBJECT) {
            exception = parseJsonException(value);
            break;
        }
        iter = json_object_iter_next(jobj, iter);
    }
    
    json_decref(jobj);
    return exception;
}
Пример #14
0
json_t* OBSAPIMessageHandler::HandleToggleMute(OBSAPIMessageHandler* handler, json_t* message)
{
    json_t* channel = json_object_get(message, "channel");

    if(channel != NULL && json_typeof(channel) == JSON_STRING)
    {
        const char* channelVal = json_string_value(channel);
        if(stricmp(channelVal, "desktop") == 0)
        {
            OBSToggleDesktopMute();
        }
        else if(stricmp(channelVal, "microphone") == 0)
        {
            OBSToggleMicMute();
        }
        else
        {
            return GetErrorResponse("Invalid channel specified.");
        }
    }
    else
    {
        return GetErrorResponse("Channel not specified.");
    }
    return GetOkResponse();
}
Пример #15
0
int
jsonUnpackOoiRespStr( json_t *responseObj, char **outStr ) {
    const char *responseStr;
    int status;

    if ( !json_is_string( responseObj ) ) {
        if ( json_is_null( responseObj ) ) {
            responseStr = "";
        }
        else {
            rodsLog( LOG_ERROR,
                     "jsonUnpackOoiRespStr: responseObj type %d is not JSON_STRING.",
                     json_typeof( responseObj ) );
            return OOI_JSON_TYPE_ERR;
        }
    }
    else {
        responseStr = json_string_value( responseObj );
    }

    if ( responseStr != NULL ) {
        *outStr = strdup( responseStr );
        status = 0;
    }
    else {
        status = OOI_JSON_NO_ANSWER_ERR;
    }
    return status;
}
Пример #16
0
/*=========================================================================*\
      Get real number from repository 
         return 0.0 on error of if key is not found
\*=========================================================================*/
double persistGetReal( const char *key )
{
  json_t *jObj;
    
/*------------------------------------------------------------------------*\
    Get Object
\*------------------------------------------------------------------------*/
  jObj = persistGetJSON( key );
  if( !jObj ) {
  	DBGMSG( "persistGetReal: (%s) not set", key );
    return 0;  
  }

/*------------------------------------------------------------------------*\
    Check type
\*------------------------------------------------------------------------*/
  if( !json_is_real(jObj) ) {
     logwarn( "Value for key \"%s\" is not a real number (%d): ", 
                          key, json_typeof(jObj) );
     return 0;
  }  

/*------------------------------------------------------------------------*\
    return real value 
\*------------------------------------------------------------------------*/
  double value = json_real_value( jObj );
  DBGMSG( "persistGetReal: (%s)=%g", key, value ); 
  return value;
}
Пример #17
0
int round_json_object_gettype(RoundJSONObject* obj)
{
  if (!obj)
    return ROUND_JSON_UNKOWN;

  switch (json_typeof(obj->jsonObj)) {
  case JSON_OBJECT:
    return ROUND_JSON_MAP;
  case JSON_ARRAY:
    return ROUND_JSON_ARRAY;
  case JSON_NULL:
    return ROUND_JSON_NULL;
  case JSON_STRING:
    return ROUND_JSON_STRING;
  case JSON_INTEGER:
    return ROUND_JSON_INTEGER;
  case JSON_REAL:
    return ROUND_JSON_REAL;
  case JSON_TRUE:
  case JSON_FALSE:
    return ROUND_JSON_BOOL;
  }

  return ROUND_JSON_UNKOWN;
}
Пример #18
0
void print_json_aux(json_t *element, int indent) {
  switch json_typeof(element) {
    case JSON_OBJECT:
      print_json_object(element, indent);
      break;
    case JSON_ARRAY:
      print_json_array(element, indent);
      break;
    case JSON_STRING:
      print_json_string(element, indent);
      break;
    case JSON_INTEGER:
      print_json_integer(element, indent);
      break;
    case JSON_REAL:
      print_json_real(element, indent);;
      break;
    case JSON_TRUE:
      print_json_true(element, indent);;
      break;
    case JSON_FALSE:
      print_json_false(element, indent);;
      break;
    case JSON_NULL:
      print_json_null(element, indent);;
      break;
    default:
      fprintf(stderr, "unrecognized JSON type %d\n", json_typeof(element));
    }
}
Пример #19
0
static launch_data_t
to_launchd_sockets(json_t *json)
{
	launch_data_t result, arr;
	const char *key;
	size_t idx;
	json_t *val, *val2;

	result = launch_data_alloc(LAUNCH_DATA_DICTIONARY);

	json_object_foreach(json, key, val) {
		arr = launch_data_alloc(LAUNCH_DATA_ARRAY);

		switch (json_typeof(val)) {
			case JSON_OBJECT:
				launch_data_array_set_index(arr,
				    create_socket(val), 0);
				break;

			case JSON_ARRAY:
				json_array_foreach(val, idx, val2) {
					launch_data_array_set_index(arr,
					    create_socket(val2), idx);
				}
				break;

			default:
				errx(EX_OSERR, "Invalid jlist specification");
		}
Пример #20
0
// gets a json value from an index
int json_array_get_object(json_t *array, int index, json_t **value)
{
  int exit_code = 0;

  check_not_null(array);
  check_not_null(value);

  json_t *json_object_peek = json_array_get(array, index);
  if (json_object_peek == NULL)
  {
    *value = NULL;
    goto cleanup;
  }

  int json_typeof_result = json_typeof(json_object_peek);
  if (json_typeof_result != JSON_OBJECT)
  {
    *value = NULL;
    goto cleanup;
  }

  *value = json_object_peek;

  goto cleanup;

error:

  exit_code = -1;

cleanup:

  return exit_code;
}
Пример #21
0
/*=========================================================================*\
      Get integer number from repository 
         return 0 on error of if key is not found
\*=========================================================================*/
int persistGetInteger( const char *key )
{
  json_t *jObj;
    
/*------------------------------------------------------------------------*\
    Get Object
\*------------------------------------------------------------------------*/
  jObj = persistGetJSON( key );
  if( !jObj ) {
  	DBGMSG( "persistGetInteger: (%s) not set", key );
    return 0;  
  }

/*------------------------------------------------------------------------*\
    Check type
\*------------------------------------------------------------------------*/
  if( !json_is_integer(jObj) ) {
     logwarn( "Value for key \"%s\" is not an integer (%d): ", 
             key, json_typeof(jObj) );
     return 0;
  }  

/*------------------------------------------------------------------------*\
    return integer value 
\*------------------------------------------------------------------------*/
  int value = json_integer_value( jObj );  
  DBGMSG( "persistGetInteger: (%s)=%d", key, value ); 
  return value;
}
Пример #22
0
json_t* extract(json_t* json, char* key)
{
    int i, s;
    json_t* temp;
    switch (json_typeof(json))
    {
        case JSON_OBJECT:
            temp = json_object_get(json, key);
            if (temp == NULL)
                {break;}
            return temp;
        case JSON_ARRAY:
            s = json_array_size(json);
            if (s == 0)
                {json_err("index out of bounds", json); break;}
            i = estrtol(key);
            if ((i < -s) || (i >= s))
                {json_err("index out of bounds", json);}
            // stupid fix for a stupid modulus operation
            while (i<0)
                {i+=s;}
            return json_array_get(json, i % s);
        case JSON_STRING:
        case JSON_INTEGER:
        case JSON_REAL:
        case JSON_TRUE:
        case JSON_FALSE:
        case JSON_NULL:
        default:
            break;
    }
    json_err("has no elements to extract", json);
    return json_null();
}
Пример #23
0
//---------------------------------------------------------------------------
int Json::get_type_node(Value &v)
{
    switch (json_typeof(current_node))
    {
        case JSON_INTEGER:
            v.type = Value::CONTAINER_TYPE_INTEGER;
            v.l = json_integer_value(current_node);
            break;
        case JSON_REAL:
            v.type = Value::CONTAINER_TYPE_REAL;
            v.d = json_real_value(current_node);
            break;
        case JSON_STRING:
            v.type = Value::CONTAINER_TYPE_STRING;
            v.s = json_string_value(current_node);
            break;
        case JSON_TRUE:
            v.type = Value::CONTAINER_TYPE_BOOL;
            v.b = true;
            break;
        case JSON_FALSE:
            v.type = Value::CONTAINER_TYPE_BOOL;
            v.b = false;
            break;
        case JSON_NULL:
            v.type = Value::CONTAINER_TYPE_NULL;
            break;
        default:
            return -1;
    }
    return 0;
}
Пример #24
0
int json_object_to_lua (lua_State *L, json_t *o)
{
        if (o == NULL) {
            lua_pushnil (L);
            return (1);
        }
        switch (json_typeof (o)) {
        case JSON_OBJECT:
            json_object_to_lua_table (L, o);
            break;
        case JSON_ARRAY:
            json_array_to_lua (L, o);
            break;
        case JSON_STRING:
            lua_pushstring (L, json_string_value (o));
            break;
        case JSON_INTEGER:
            lua_pushinteger (L, json_integer_value (o));
            break;
        case JSON_REAL:
            lua_pushnumber (L, json_real_value (o));
            break;
        case JSON_TRUE:
            lua_pushboolean (L, 1);
            break;
        case JSON_FALSE:
            lua_pushboolean (L, 0);
            break;
        case JSON_NULL:
            /* XXX: crap. */
            break;
        }
        return (1);
}
Пример #25
0
char* pretty_type(json_t* json)
{
    if (json == NULL)
        {err("internal error: null pointer"); return "NULL";}
    switch (json_typeof(json))
    {
        case JSON_OBJECT:
            return "object";
        case JSON_ARRAY:
            return "array";
        case JSON_STRING:
            return "string";
        case JSON_INTEGER:
        case JSON_REAL:
            return "number";
        case JSON_TRUE:
        case JSON_FALSE:
            return "bool";
        case JSON_NULL:
            return "null";
        default:
            err("internal error: unknown type");
            return "NULL";
    }
}
Пример #26
0
//----------------------------------------------------------------//
void MOAIHarness::ReceiveEvaluate(lua_State *L, json_t* node)
{
	// Get the evaluation.
	json_t* np_eval = json_object_get(node, "Evaluation");
	if (np_eval == NULL || json_typeof(np_eval) != JSON_STRING)
		return;

	// Get the current stack index so we know how many
	// positions to clear afterward.
	int top = lua_gettop(L);

	// Load the string from the message
	MOAIScopedLuaState state ( L );
	int status = luaL_loadstring ( state, json_string_value(np_eval) );
	if ( state.PrintErrors ( ZLLog::CONSOLE, status )) return;

	// Call the string
	state.DebugCall ( 0, 0 );

	// Now unload all of the things we just put on the stack
	// until the stack is the same size.
	std::string indent = "    ";
	json_t* result = MOAIHarness::ConvertStackPartialToJSON(L, top + 1, lua_gettop(L));
	lua_pop(L, lua_gettop(L) - top);

	// Send the message back to the IDE.
	MOAIHarness::SendResult(result);
}
Пример #27
0
ctr_object* ctr_json_create_object(json_t* root, ctr_object* gt) {
    switch(json_typeof(root)) {
        case JSON_OBJECT: {
            ctr_object* sub = ctr_internal_create_object(CTR_OBJECT_TYPE_OTOBJECT);
            ctr_set_link_all(sub, gt);
            // size_t size;
            const char *key;
            json_t *value;
            ctr_argument* argl = ctr_heap_allocate(sizeof(*argl));
            argl->next = ctr_heap_allocate(sizeof(*argl));
            // size = json_object_size(root);
            json_object_foreach(root, key, value) {
              char* k = (char*)key;
              ctr_object* ko = ctr_build_string_from_cstring(k);
              ctr_object* vo = ctr_json_create_object(value, gt);
              argl->object = vo;
              argl->next->object = ko;
              sub = ctr_map_put(sub, argl);
            }
            ctr_heap_free(argl->next);
            ctr_heap_free(argl);
            return sub;
          }
        case JSON_ARRAY: {
          ctr_object* arr = ctr_array_new(CtrStdArray, NULL);
          ctr_argument* arg = ctr_heap_allocate(sizeof(ctr_argument));
          size_t i;
          size_t size = json_array_size(root);
          for (i = 0; i < size; i++) {
            arg->object = ctr_json_create_object(json_array_get(root, i), gt);
            ctr_array_push(arr, arg);
          }
          ctr_heap_free(arg);
          return arr;
        }
        case JSON_STRING: {
          ctr_object* str = ctr_build_string((char*)json_string_value(root), json_string_length(root));
          return str;
        }
        case JSON_INTEGER: {
          return ctr_build_number_from_float(json_integer_value(root));
        }
        case JSON_REAL: {
          return ctr_build_number_from_float(json_real_value(root));
        }
        case JSON_FALSE: {
          return ctr_build_bool(0);
        }
        case JSON_TRUE: {
          return ctr_build_bool(1);
        }
        case JSON_NULL: {
          return ctr_build_nil();
        }
        default: {
          CtrStdFlow = ctr_build_string_from_cstring("Unrecognized JSON type");
          return CtrStdNil;
        }
    }
Пример #28
0
int JSON::getJSONType()
{
    if (!_json)
    {
        return JSON_NULL;
    }
    return json_typeof(_json);
}
Пример #29
0
//----------------------------------------------------------------//
void MOAIHarness::ReceiveBreakSetAlways(lua_State *L, json_t* node)
{
	// Get the breakpoint data.
	json_t* np_file = json_object_get(node, "FileName");
	if (np_file == NULL || json_typeof(np_file) != JSON_STRING)
		return;
	json_t* np_line = json_object_get(node, "LineNumber");
	if (np_line == NULL || json_typeof(np_line) != JSON_INTEGER)
		return;

	// Store breakpoint data.
	const char* file = json_string_value(np_file);
	int line = ( int )json_integer_value(np_line);

	// Add the breakpoint.
	int identifier = MOAIHarness::mPathDictionary.GetIdentifier(file);
	mBreakpoints.insert(mBreakpoints.begin(), MOAIBreakpoint(identifier, line));
}
Пример #30
0
const Json Json::operator[]( const char *k ) const
{
	if ( json_typeof(data) == JSON_OBJECT )
	{
		json_t *member = json_object_get( data, k );
		if ( member != NULL )
			return member;
	}
	return *Json::Null;
}