Skip to content

Conversation

@smaillet
Copy link
Member

Resolves #200

Breaking Change

This is a breaking change. The behavior of Context.CreateConstantString(string) has changed slightly. It now constructs a valid C string WITH a null terminator, which is generally what would be expected of something called "string". (The (string,bool) overload remains, to allow apps to be explicit with intent and get the previous behavior) Additionally, the ConstantDataSequential.IsString property now reflects whether the string is a C string (terminating null but no embedded nulls) and the ConstantDataSequential.IsI8Sequence was added to provide the previous behavior of IsString, which was simply that the underlying sequence element type was i8 (with or without a terminator). While this is a breaking change and may cause some issues on updating to this version, it is intended to help clarify the behavior and clean up some less than intuitive behavior of the previous implementation.


  • Added error handling to parsing of YAML configuration in bindings generator app.
  • Added RawData property to ConstandDataSequential (and used it for the ExtractAsString implementations
  • Added ExtractAsString overload that accepts an Encoding
  • ExtractAsString now automatically discards the terminating null if the underlying data is a C String, while allowing extraction of strings without a terminator and in different encodings.

# BREAKING CHANGE
This is a breaking change. The behavior of Context.CreateConstantString(string) has changed slightly. It now constructs a valid C string WITH a null terminator, which is generally what would be expected of something called "string". (The (string,bool) overload remains, to allow apps to be explicit with intent and get the previous behavior) Additionally, the ConstantDataSequential.IsString property now reflects whether the string is a C string (terminating null but no embedded nulls) and the ConstantDataSequential.IsI8Sequence was added to provide the previous behavior of IsString, which was simply that the underlying sequence element type was i8 (with or without a terminator)
---
* Added error handling to parsing of YAML configuration in bindings generator app.
* Added RawData property to ConstandDataSequential (and used it for the ExtractAsString implementations
* Added ExtractAsString overload that accepts an Encoding
* ExtractAsString now automatically discards the terminating null if the underlying data is a C String, while allowing extraction of strings without a terminator and in different encodings.
@smaillet smaillet merged commit e037b2e into UbiquityDotNET:develop Jan 17, 2021
@smaillet smaillet deleted the ConstantDataString branch January 17, 2021 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] - ConstantDataSequential does not have a way of accessing non-string data

1 participant