|
/* Gamelon(tm) File I/O Library Sample Code C++ Language */ /* (C)1994 Menai Corporation(tm) Released for public use */
/* Example 6a. How to specify annotations during a block */ /* alteration. */
/* The programmer can specify a separate set of */ /* annotations for each object in a block alteration. */ /* For block aggregating alterations, any annotations */ /* specified between time the alteration is initiated */ /* and the time of the block aggregating call will be */ /* associated with the aggregate. After the type of */ /* block alteration is specified, any annotations */ /* specified will be associated with the next object */ /* written into the alteration. For example: */ /* (Assume an empty file.) */
#include <stdlib.h> #include "gfcursor.hpp"
int main(void) { char newchar = 'u'; long l = 5700304; int valid; CURSOR *c = new CURSOR("newfile"); c>eCursorQueryValid(&valid); if (!valid) exit(1); c>eCursorMoveIn(); c>eCursorMovePreFirst(); c>eAltAppend(); c>eObjSetComment("Responses"); c>eObjSetClass(10); /* The above annotations will be associated */ /* with the aggregate itself. */ c>eAltStartAggregating(); c>eObjSetComment("Question 1"); c>eObjSetClass(144); c>eObjWrite(newchar); c>eObjApplyIdentity(); c>eObjSetComment("Question 2"); c>eObjWrite(l); c>eAltCommit(); delete c; return 0; }
#if 0 /* Ending file layout (in vertical display format): */ /* { */ /* {CL(10):CO("Responses") */ /* ['u':CL(144):CO("Question 1")] */ /* [5700304:ID(/*3*/)]:CO("Question 2")] */ /* } */ /* } */ #endif |
||||||||||||||
| |
||||||||||||||
|
Home | Product | Consulting | Programming | Reviews | Company | Site Map | Guest Book |
||||||||||||||
|
Menai Corporation, 1010 El Camino Real, Suite 300, Menlo Park, California 94025-4335 |
||||||||||||||
|
Copyright © 1996-98 Menai Corporation. All Rights Reserved. Menai, Gamelon and gamelon(stylized) are worldwide trademarks of Menai Corporation, registered in the United States of America, and the .[g] logo is a worldwide trademark of Menai Corporation. All other trademarks are owned by their respective owners. |
||||||||||||||