https://bugs.kde.org/show_bug.cgi?id=421357

--- Comment #1 from Friedrich W. H. Kossebau <kosse...@kde.org> ---
Alex, would you remember a reason besides no spare time resources that
maxCharCount and maxByteCount could not be also optionally scripted properties?
Would look into this otherwise in the next weeks.

FTR, as another work-around (though resulting in data reparsing) one can use
the updateFunc, starting with maxCharCount or maxByteCount set to 0 and then
have the value updated from that type-wide generic function.

E.g. with JS:
        var obj = struct({
                length: uint16(),
                data: string("utf-8").set({
                    maxByteCount: 0,
                    updateFunc: function() { this.maxByteCount =
this.parent.length.value; }
            })
        });
or with XML
        <struct name="variablelengthstring">
                <primitive name="length" type="uint16" />
                <string name="data" encoding="utf-8" maxByteCount="0"
updateFunc="function() { this.maxByteCount = this.parent.length.value; }">
        </struct>

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to