Advertisement
Guest User

a_json

a guest
Nov 6th, 2017
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. #if defined _a_json_included
  2. #endinput
  3. #endif
  4. #define _a_json_included
  5.  
  6. #include <a_samp>
  7.  
  8. #if !defined JSON_DEFAULT_DELIMITER
  9. #define JSON_DEFAULT_DELIMITER '/'
  10. #endif
  11.  
  12. #define JSON_NULL 0
  13. #define JSON_STRING 1
  14. #define JSON_NUMBER 2
  15. #define JSON_BOOL 3
  16. #define JSON_ARRAY 4
  17. #define JSON_NODE 5
  18.  
  19. native JSONNode:json_parse_file(const file_path[]);
  20. native JSONNode:json_parse_string(const string[]);
  21. native json_close(JSONNode:node);
  22. native json_get_type(JSONNode:node, const path[] = '\0', const path_delim = JSON_DEFAULT_DELIMITER);
  23. native JSONNode:json_get_node(JSONNode:node, const path[], const path_delim = JSON_DEFAULT_DELIMITER);
  24. native bool:json_get_bool(JSONNode:node, const path[] = '\0', const path_delim = JSON_DEFAULT_DELIMITER);
  25. native json_get_int(JSONNode:node, const path[] = '\0', const path_delim = JSON_DEFAULT_DELIMITER);
  26. native Float:json_get_float(JSONNode:node, const path[] = '\0', const path_delim = JSON_DEFAULT_DELIMITER);
  27. native json_get_string(JSONNode:node, dst[], const len = sizeof(dst), const path[] = '\0', const bool:packed = false, const path_delim = JSON_DEFAULT_DELIMITER);
  28. native json_get_name(JSONNode:node, dst[], const len = sizeof(dst), const bool:packed = false);
  29.  
  30. native JSONArray:json_get_array(JSONNode:node, const path[] = '\0', const path_delim = JSON_DEFAULT_DELIMITER);
  31. native json_array_count(JSONArray:array);
  32. native JSONNode:json_array_at(JSONArray:array, const index);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement