-- WRemoteGetImpl.Mesa, -- Schmidt February 9, 1983 4:15 pm -- Stewart March 28, 1983 5:19 pm -- Last Edited by: Maxwell, January 25, 1983 2:14 pm DIRECTORY BringOverCall: TYPE USING [CedarBringOver], IO: TYPE USING[Flush, Handle, PutF, ResetUserAbort, rope], IOMisc: TYPE USING [AskUser], Rope: TYPE USING[Cat, Fetch, Flatten, Length, ROPE, Text], RopeInline: TYPE USING[InlineFlatten], TypeScript: TYPE USING [UserAbort], VFTOps: TYPE USING [Handle], ViewerTools: TYPE USING [GetContents]; WRemoteGetImpl: CEDAR PROGRAM IMPORTS BringOverCall, IO, IOMisc, Rope, RopeInline, TypeScript, ViewerTools EXPORTS VFTOps = { GetTheFile: PUBLIC PROC[self: VFTOps.Handle, getboth: BOOL]= { ENABLE ABORTED => { self.log.ResetUserAbort[]; self.log.PutF["Get%s Aborted.\n", IO.rope[IF getboth THEN "Both" ELSE ""]]; GOTO leave; }; dfFileRope, fileRef: Rope.ROPE; dfFileRef, file: Rope.Text; inx, start: CARDINAL _ 0; usingList: LIST OF Rope.Text _ NIL; switches: ARRAY CHAR['a .. 'z] OF BOOL _ ALL[FALSE]; fileRef _ self.sourceRope; -- If the first character in dfFileBox is '[ then use it directly. Otherwise, concatenate any -- (non-empty) host or directory parameters. dfFileRope _ ViewerTools.GetContents[self.dfFileBox]; IF dfFileRope.Fetch[0] # '[ THEN { IF self.directoryRope.Length[] > 0 THEN dfFileRope _ Rope.Cat["<", self.directoryRope, ">", dfFileRope]; IF self.hostRope.Length[] > 0 THEN dfFileRope _ Rope.Cat["[", self.hostRope, "]", dfFileRope]; }; dfFileRef _ RopeInline.InlineFlatten[dfFileRope]; IF fileRef ~= NIL THEN { WHILE inx < fileRef.Length[] DO IF TypeScript.UserAbort[self.ts] THEN ERROR ABORTED; WHILE inx < fileRef.Length[] AND fileRef.Fetch[inx] = ' DO inx _ inx + 1; ENDLOOP; start _ inx; WHILE inx < fileRef.Length[] AND fileRef.Fetch[inx] ~= ' DO inx _ inx + 1; ENDLOOP; IF inx = start THEN LOOP; file _ Rope.Flatten[fileRef, start, inx-start]; IF getboth THEN { usingList _ CONS[RopeInline.InlineFlatten[Rope.Cat[file, ".Mesa"]], usingList]; usingList _ CONS[RopeInline.InlineFlatten[Rope.Cat[file, ".Bcd"]], usingList]; } ELSE usingList _ CONS[file, usingList]; ENDLOOP; }; switches['a] _ NOT self.verify; switches['p] _ self.publiconly; switches['v] _ FALSE; BringOverCall.CedarBringOver[listOfFiles: LIST[dfFileRef], usingListOfRopes: usingList, in: self.logIn, out: self.log, switches: switches, confirmData: self.ts, Confirm: MyConfirm]; self.log.PutF["\n===============================\n"]; self.log.Flush[]; EXITS leave => NULL; }; MyConfirm: PROC[in, out: IO.Handle, data: REF ANY, msg: Rope.ROPE, dch: CHAR] RETURNS[CHAR] = { value: ATOM; value _ IOMisc.AskUser[msg: msg, in: in, out: out, keyList: LIST[$Yes, $No, $All, $Quit]]; -- order is important SELECT value FROM $All => RETURN['a]; $No => RETURN['n]; $Quit => RETURN['q]; $Yes => RETURN['y]; ENDCASE => ERROR; }; BuildOuter: PUBLIC PROC [self: VFTOps.Handle] = {}; RGDestroy: PUBLIC PROC [self: VFTOps.Handle] = {}; }. July 3, 1982 8:48 pm, Stewart, better df file name construction September 5, 1982 5:39 pm Schmidt, new interface to BringOverCall