1
0

a_json.inc 1.4 KB

1234567891011121314151617181920212223242526272829303132
  1. #if defined _a_json_included
  2. #endinput
  3. #endif
  4. #define _a_json_included
  5. #include <a_samp>
  6. #if !defined JSON_DEFAULT_DELIMITER
  7. #define JSON_DEFAULT_DELIMITER '/'
  8. #endif
  9. #define JSON_NULL 0
  10. #define JSON_STRING 1
  11. #define JSON_NUMBER 2
  12. #define JSON_BOOL 3
  13. #define JSON_ARRAY 4
  14. #define JSON_NODE 5
  15. native JSONNode:json_parse_file(const file_path[]);
  16. native JSONNode:json_parse_string(const string[]);
  17. native json_close(JSONNode:node);
  18. native json_get_type(JSONNode:node, const path[] = '\0', const path_delim = JSON_DEFAULT_DELIMITER);
  19. native JSONNode:json_get_node(JSONNode:node, const path[], const path_delim = JSON_DEFAULT_DELIMITER);
  20. native bool:json_get_bool(JSONNode:node, const path[] = '\0', const path_delim = JSON_DEFAULT_DELIMITER);
  21. native json_get_int(JSONNode:node, const path[] = '\0', const path_delim = JSON_DEFAULT_DELIMITER);
  22. native Float:json_get_float(JSONNode:node, const path[] = '\0', const path_delim = JSON_DEFAULT_DELIMITER);
  23. native json_get_string(JSONNode:node, dst[], const len = sizeof(dst), const path[] = '\0', const bool:packed = false, const path_delim = JSON_DEFAULT_DELIMITER);
  24. native json_get_name(JSONNode:node, dst[], const len = sizeof(dst), const bool:packed = false);
  25. native JSONArray:json_get_array(JSONNode:node, const path[] = '\0', const path_delim = JSON_DEFAULT_DELIMITER);
  26. native json_array_count(JSONArray:array);
  27. native JSONNode:json_array_at(JSONArray:array, const index);