|
resonance 1.0.1
|

Go to the source code of this file.
Functions | |
| OBStream & | SaveHxStr (OBStream &stream, const HxStr &text) |
| Write a string as a four-byte length followed by its text, with no terminator. | |
| IBStream & | LoadHxStr (IBStream &stream, HxStr &text) |
| Read a string written by SaveHxStr() back in place. | |
Write a string as a four-byte length followed by its text, with no terminator.
Every packet that carries a string open-codes this sequence, and the image holds no out-of-line copy, which is the shape of an inline function. The call sites are GameChatPacket::saveGuts() at 0x003e8458, its second emission at 0x003e8720 in TestArbiterPacket's table, and SPJoinDenyPacket::saveGuts() at 0x003e5d58. The name and the placement are inferred. The length goes through OBStream::WriteLE() and the text through OBStream::Write() on the same stream, and only the second call's result is returned.
| stream | The stream to write to. |
| text | The string to write. |
Read a string written by SaveHxStr() back in place.
The string is resized through HxStr::Alloc() to the length read, and the text is then read into its buffer. An empty string has no buffer, so the zero-byte read targets the shared empty literal instead, exactly as the open-coded sequences do. The call sites are the restoreGuts() members paired with the saveGuts() members listed on SaveHxStr().
| stream | The stream to read from. |
| text | The string to fill. |