Release v0.5.1: IECStringVar / IECWStringVar read-through proxies#157
Merged
Conversation
…ar (#156) Without these proxies, user code reading a STRING / WSTRING pin has to write `name.get().c_str()` / `name.get().length()` / `name.get()[i]` for every read — `IECStringVar` would otherwise expose nothing but `get()` / `set()` / `operator=` to its consumers. Add `length()`, `c_str()`, and `operator[]` (read-only — returns char by value) on both `IECStringVar<MaxLen>` and `IECWStringVar<MaxLen>`, routed through the force-aware value (`forced_value_` when forcing is active, `value_` otherwise). This mirrors how `IECVar<T>::operator T()` already exposes the underlying numeric for force-respecting reads on numeric pins. Comparison operators (`operator==` / `operator!=`) are intentionally NOT proxied — the free-function overloads at the bottom of each header already cover every cross-class compare path, and adding member operators would risk overload ambiguity at ST call sites that currently bind to the free functions. Unlocks the openplc-editor / openplc-web c_blocks STRING/WSTRING standardization PRs — user C/C++ POU code can now read pins via plain `name.length()` / `name.c_str()` / `name[i]`. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced Jun 2, 2026
Merged
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.
Summary
Release v0.5.1 with the read-through proxy methods added to
IECStringVar/IECWStringVar(from #156).What's new since v0.5.0
length(),c_str(),operator[]proxies onIECStringVar<MaxLen>andIECWStringVar<MaxLen>, force-aware (route throughforced_value_when forcing is active,value_otherwise).name.length()/name.c_str()/name[i]syntax instead ofname.get().length()etc.Unlocks downstream
Test plan
🤖 Generated with Claude Code