-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
1 parent
4878acf
commit 99c0e82
Showing
7 changed files
with
1,066 additions
and
345 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,5 @@ | |
0x3 | ||
0x4 | ||
0x5 | ||
0x6 | ||
0x6 | ||
0x7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.