Skip to content

Releases: ProjectSky/sm-ext-yyjson

ver 1.0.7

04 Nov 13:56
Compare
Choose a tag to compare

refactor: improve memory management and error handling

Memory management improvements:

  • Add custom deleter for yyjson_mut_doc in shared_ptr
  • Add CreateDocument and CopyDocument helper method for consistent document creation and copy
  • Update all document creation points to use shared_ptr
  • Keep m_pVal_mut as raw pointer since it's managed by document

Error handling improvements:

  • Add int64 value validity check
  • Add bounds checking for array operations
  • Add key existence validation for object operations
  • Enhance error messages with more context and details
  • Add type checking with descriptive error messages
  • Improve error reporting for JSON pointer operations

Add methods to find the index of values in JSON arrays:

  • IndexOfBool: Find boolean value
  • IndexOfString: Find string value
  • IndexOfInt: Find integer value
  • IndexOfFloat: Find float value

Add YYJSONArray.Sort method to sort array elements

  • Support ascending/descending order
  • Compare elements based on their types and values
  • Handle different value types (string, number, bool)
  • Use stable sort to maintain relative order of equal elements

Add YYJSONObject.Sort method to sort object by keys

  • Support ascending/descending order for key names
  • Maintain key-value associations during sorting
  • Use stable sort to preserve order of equal keys

Update README and API documentation

  • Add detailed comments for sort methods

ver 1.0.2

22 Aug 14:43
Compare
Choose a tag to compare
  • improved error handling
  • improved the log when write/read errors
  • new native GetTypeDesc
  • update yyjson