Repository navigation
Add support for basic information of XmlDocument struct - #170
Merged
Merged
Conversation
jameslan
requested changes
Aug 10, 2026
Comment on lines
+346
to
+362
| getStandalone(): number | undefined { | ||
| return this._ptr === 0 ? undefined : XmlDocStruct.standalone(this._ptr); | ||
| } | ||
|
|
||
| /** | ||
| * Get version string from XML declaration | ||
| */ | ||
| getVersion(): string | undefined { | ||
| return this._ptr === 0 ? undefined : XmlDocStruct.version(this._ptr); | ||
| } | ||
|
|
||
| /** | ||
| * Get actual encoding if any | ||
| */ | ||
| getEncoding(): string | null | undefined { | ||
| return this._ptr === 0 ? undefined : XmlDocStruct.encoding(this._ptr); | ||
| } |
Owner
There was a problem hiding this comment.
This library prefers property getters/setters over get/set methods. Please convert these new methods. You can refer to the XmlDocument.root property getter. Thanks!
| * -2 if there is an XML declaration, but no standalone attribute was specified | ||
| */ | ||
| getStandalone(): number | undefined { | ||
| return this._ptr === 0 ? undefined : XmlDocStruct.standalone(this._ptr); |
Owner
There was a problem hiding this comment.
There's no need to have a null check for _ptr. The object is created with a non-null ptr, and it is set to zero only after disposed.
- Convert getVersion()/getEncoding()/getStandalone() to version/encoding/ standalone property getters, matching XmlDocument.root style - Drop the _ptr null checks; the pointer is only zero after dispose - Update tests to the real values of a freshly created document and keep the doc alive for the duration of each test
|
Coverage after merging feature/xmldocinfo into master will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
github-actions Bot
pushed a commit
that referenced
this pull request
Sep 5, 2026
…rmation of XmlDocument struct (#170)"
jameslan
added a commit
that referenced
this pull request
Sep 5, 2026
* Add support for basic information of XmlDocument struct (#169) --------- Co-authored-by: James Lan <jameslan@gmail.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #169