From da134a373763d7d937c4959f0bdce531a0cbbd3c Mon Sep 17 00:00:00 2001 From: David Rose Date: Thu, 24 Jun 2004 07:54:48 +0000 Subject: [PATCH] comments about seeking to switches --- direct/src/doc/dcPacker.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/direct/src/doc/dcPacker.txt b/direct/src/doc/dcPacker.txt index 6918b1ff9e..a4f1cca215 100755 --- a/direct/src/doc/dcPacker.txt +++ b/direct/src/doc/dcPacker.txt @@ -125,6 +125,13 @@ pop() to unpack the nested elements of an array that you seek to. return; } +To seek to a field nested within another structure, use a dot to +compose the names: "parentName.fieldName". + +In unpack mode, you may seek to any field that has a name, including a +field within the currently active case of a switch. You may also seek +to a switch parameter variable. + REPACK MODE (random write) @@ -150,6 +157,13 @@ field with get_data() and get_length(), just as in pack mode. memcpy(result, packer.get_data(), packer.get_length()); +In repack mode, you may not traverse from beginning to end of the +record--you must explicitly seek to each field you intend to repack. +You may seek to a field within the currently active case of a switch. +You may not seek directly to a switch parameter variable--repacking +this would invalidate the remaining contents of the switch--but you +may seek to the switch itself (if it has a name) and repack the entire +contents of the switch at once. ADDITIONAL NOTES