EnvelopeFormatP1517V1AuxImpl:
CEDAR
PROGRAM
IMPORTS Convert, Rope, MailTransportP17V5Aux
EXPORTS EnvelopeFormatP1517V1Aux ~ {
OPEN EnvelopeFormatP1517V1, EnvelopeFormatP1517V1Aux;
ROPE: TYPE ~ Rope.ROPE;
ExposeReport:
PUBLIC
PROC [arg: Report, level:
NAT]
RETURNS [res:
ROPE] ~ {
res ¬ "[";
res ¬ Rope.Cat[res, "originalEnvelope~", MailTransportP17V5Aux.ExposeEnvelope[arg.originalEnvelope, (level+1)], ", "];
res ¬ Rope.Cat[res, "fateOfThisReport~", ExposeFate[arg.fateOfThisReport, (level+1)], ", "];
res ¬ Rope.Cat[res, "reportType~", ExposeRepType[arg.reportType, (level+1)], "]"];
};
ExposeNonDelType:
PUBLIC
PROC [arg: NonDelType, level:
NAT]
RETURNS [res:
ROPE] ~ {
res ¬ "[";
res ¬ Rope.Cat[res, "reason~", ExposeReason[arg.reason, (level+1)], ", "];
res ¬ Rope.Cat[res, "reportCreationPostmark~", ExposePostmark[arg.reportCreationPostmark, (level+1)], "]"];
};
ExposeNonDeliveredRecipient:
PUBLIC
PROC [arg: NonDeliveredRecipient, level:
NAT]
RETURNS [res:
ROPE] ~ {
res ¬ "[";
res ¬ Rope.Cat[res, "recipient~", MailTransportP17V5Aux.ExposeRecipient[arg.recipient, (level+1)], ", "];
res ¬ Rope.Cat[res, "reason~", ExposeReason[arg.reason, (level+1)], "]"];
};
ExposePriority:
PUBLIC
PROC [arg: Priority, level:
NAT]
RETURNS [res:
ROPE] ~ {
SELECT arg
FROM
nonUrgent => res ¬ "nonUrgent";
normal => res ¬ "normal";
urgent => res ¬ "urgent";
unspecified => res ¬ "unspecified";
ENDCASE => ERROR
};
ExposeFailList:
PUBLIC
PROC [arg: FailList, level:
NAT]
RETURNS [res:
ROPE] ~ {
res ¬ "[";
FOR i:
CARDINAL
IN [0..arg.length)
DO
res ¬ Rope.Cat[res, IF i>0 THEN ", " ELSE NIL, ExposeNonDeliveredRecipient[arg.body[i], (level+1)]];
ENDLOOP;
res ¬ Rope.Concat[res, "]"];
};
ExposeFate:
PUBLIC
PROC [arg: Fate, level:
NAT]
RETURNS [res:
ROPE] ~ {
res ¬ Rope.Cat["Fate(", ExposeFateKind[arg.type, (level+1)], "): "];
WITH arg
SELECT
FROM
it:
REF FateObject.delivered => {
res ¬ Rope.Concat[res, ExposeDelType[it.delivered, (level+1)]] };
it:
REF FateObject.notDelivered => {
res ¬ Rope.Concat[res, ExposeNonDelType[it.notDelivered, (level+1)]] };
ENDCASE => ERROR
};
ExposeFateKind:
PUBLIC
PROC [arg: FateKind, level:
NAT]
RETURNS [res:
ROPE] ~ {
SELECT arg
FROM
delivered => res ¬ "delivered";
notDelivered => res ¬ "notDelivered";
ENDCASE => ERROR
};
ExposeX400SpecificReportInformation:
PUBLIC
PROC [arg: X400SpecificReportInformation, level:
NAT]
RETURNS [res:
ROPE] ~ {
res ¬ "[";
FOR i:
CARDINAL
IN [0..arg.length)
DO
res ¬ Rope.Cat[res, IF i>0 THEN ", " ELSE NIL, ExposeX400ReportItem[arg.body[i], (level+1)]];
ENDLOOP;
res ¬ Rope.Concat[res, "]"];
};
ExposeReason:
PUBLIC
PROC [arg: Reason, level:
NAT]
RETURNS [res:
ROPE] ~ {
SELECT arg
FROM
noSuchRecipient => res ¬ "noSuchRecipient";
noMailboxForRecipient => res ¬ "noMailboxForRecipient";
illegalName => res ¬ "illegalName";
timeout => res ¬ "timeout";
reportNotAllowed => res ¬ "reportNotAllowed";
messageTooLong => res ¬ "messageTooLong";
ambiguousRName => res ¬ "ambiguousRName";
illegalCharacters => res ¬ "illegalCharacters";
unsupportedBodyparts => res ¬ "unsupportedBodyparts";
unsupportedContentsType => res ¬ "unsupportedContentsType";
transientProblem => res ¬ "transientProblem";
contentSyntaxError => res ¬ "contentSyntaxError";
tooManyRecipients => res ¬ "tooManyRecipients";
protocolViolation => res ¬ "protocolViolation";
x400PragmaticConstraintViolation => res ¬ "x400PragmaticConstraintViolation";
x400NoBilateralAgreement => res ¬ "x400NoBilateralAgreement";
accessRightsInsufficientForDL => res ¬ "accessRightsInsufficientForDL";
other => res ¬ "other";
ENDCASE => ERROR
};
ExposeSucList:
PUBLIC
PROC [arg: SucList, level:
NAT]
RETURNS [res:
ROPE] ~ {
res ¬ "[";
FOR i:
CARDINAL
IN [0..arg.length)
DO
res ¬ Rope.Cat[res, IF i>0 THEN ", " ELSE NIL, ExposeDeliveredRecipient[arg.body[i], (level+1)]];
ENDLOOP;
res ¬ Rope.Concat[res, "]"];
};
ExposeTableOfContents:
PUBLIC
PROC [arg: TableOfContents, level:
NAT]
RETURNS [res:
ROPE] ~ {
res ¬ "[";
FOR i:
CARDINAL
IN [0..arg.length)
DO
res ¬ Rope.Cat[res, IF i>0 THEN ", " ELSE NIL, ExposeTOCEntry[arg.body[i], (level+1)]];
ENDLOOP;
res ¬ Rope.Concat[res, "]"];
};
ExposeDeliveredRecipient:
PUBLIC
PROC [arg: DeliveredRecipient, level:
NAT]
RETURNS [res:
ROPE] ~ {
res ¬ "[";
res ¬ Rope.Cat[res, "recipient~", MailTransportP17V5Aux.ExposeRecipient[arg.recipient, (level+1)], ", "];
res ¬ Rope.Cat[res, "when~", Convert.RopeFromCard[arg.when], "]"];
};
ExposeX400ReportItem:
PUBLIC
PROC [arg: X400ReportItem, level:
NAT]
RETURNS [res:
ROPE] ~ {
res ¬ "[";
FOR i:
CARDINAL
IN [0..arg.length)
DO
res ¬ Rope.Cat[res, IF i>0 THEN ", " ELSE NIL, Convert.RopeFromCard[arg.body[i]]];
ENDLOOP;
res ¬ Rope.Concat[res, "]"];
};
ExposeConvertedItem:
PUBLIC
PROC [arg: ConvertedItem, level:
NAT]
RETURNS [res:
ROPE] ~ {
SELECT arg
FROM
ia5TextToTeletex => res ¬ "ia5TextToTeletex";
teletexToTelex => res ¬ "teletexToTelex";
teletexToIA5Text => res ¬ "teletexToIA5Text";
telexToTeletex => res ¬ "telexToTeletex";
ENDCASE => ERROR
};
ExposeRepTypeKind:
PUBLIC
PROC [arg: RepTypeKind, level:
NAT]
RETURNS [res:
ROPE] ~ {
SELECT arg
FROM
dlMember => res ¬ "dlMember";
other => res ¬ "other";
ENDCASE => ERROR
};
ExposeTOCEntry:
PUBLIC
PROC [arg: TOCEntry, level:
NAT]
RETURNS [res:
ROPE] ~ {
res ¬ "[";
res ¬ Rope.Cat[res, "type~", Convert.RopeFromCard[arg.type], ", "];
res ¬ Rope.Cat[res, "sizeInBytes~", Convert.RopeFromCard[arg.sizeInBytes], "]"];
};
ExposeDLMem:
PUBLIC
PROC [arg: DLMem, level:
NAT]
RETURNS [res:
ROPE] ~ {
res ¬ "[";
res ¬ Rope.Cat[res, "dlName~", MailTransportP17V5Aux.ExposeRName[arg.dlName, (level+1)], ", "];
res ¬ Rope.Cat[res, "invalidDLRecipients~", ExposeInvalRecip[arg.invalidDLRecipients, (level+1)], "]"];
};
ExposeOtherRep:
PUBLIC
PROC [arg: OtherRep, level:
NAT]
RETURNS [res:
ROPE] ~ {
res ¬ "[";
res ¬ Rope.Cat[res, "succeeded~", ExposeSucList[arg.succeeded, (level+1)], ", "];
res ¬ Rope.Cat[res, "failed~", ExposeFailList[arg.failed, (level+1)], "]"];
};
ExposePostmark:
PUBLIC
PROC [arg: Postmark, level:
NAT]
RETURNS [res:
ROPE] ~ {
res ¬ "[";
res ¬ Rope.Cat[res, "postedAt~", MailTransportP17V5Aux.ExposeRName[arg.postedAt, (level+1)], ", "];
res ¬ Rope.Cat[res, "time~", Convert.RopeFromCard[arg.time], "]"];
};
ExposeTransportOptions:
PUBLIC
PROC [arg: TransportOptions, level:
NAT]
RETURNS [res:
ROPE] ~ {
res ¬ "[";
res ¬ Rope.Cat[res, "returnOfContents~", Convert.RopeFromBool[arg.returnOfContents], ", "];
res ¬ Rope.Cat[res, "alternateRecipientAllowed~", Convert.RopeFromBool[arg.alternateRecipientAllowed], "]"];
};
ExposeInvalRecip:
PUBLIC
PROC [arg: InvalRecip, level:
NAT]
RETURNS [res:
ROPE] ~ {
res ¬ "[";
FOR i:
CARDINAL
IN [0..arg.length)
DO
res ¬ Rope.Cat[res, IF i>0 THEN ", " ELSE NIL, ExposeNonDeliveredRecipient[arg.body[i], (level+1)]];
ENDLOOP;
res ¬ Rope.Concat[res, "]"];
};
ExposeAuthenticationLevelOfSender:
PUBLIC
PROC [arg: AuthenticationLevelOfSender, level:
NAT]
RETURNS [res:
ROPE] ~ {
SELECT arg
FROM
strong => res ¬ "strong";
simple => res ¬ "simple";
foreign => res ¬ "foreign";
unknown => res ¬ "unknown";
ENDCASE => ERROR
};
ExposeRepType:
PUBLIC
PROC [arg: RepType, level:
NAT]
RETURNS [res:
ROPE] ~ {
res ¬ Rope.Cat["RepType(", ExposeRepTypeKind[arg.type, (level+1)], "): "];
WITH arg
SELECT
FROM
it:
REF RepTypeObject.dlMember => {
res ¬ Rope.Concat[res, ExposeDLMem[it.dlMember, (level+1)]] };
it:
REF RepTypeObject.other => {
res ¬ Rope.Concat[res, ExposeOtherRep[it.other, (level+1)]] };
ENDCASE => ERROR
};
ExposeConverted:
PUBLIC
PROC [arg: Converted, level:
NAT]
RETURNS [res:
ROPE] ~ {
res ¬ "[";
FOR i:
CARDINAL
IN [0..arg.length)
DO
res ¬ Rope.Cat[res, IF i>0 THEN ", " ELSE NIL, ExposeConvertedItem[arg.body[i], (level+1)]];
ENDLOOP;
res ¬ Rope.Concat[res, "]"];
};
ExposeDelType:
PUBLIC
PROC [arg: DelType, level:
NAT]
RETURNS [res:
ROPE] ~ {
SELECT arg
FROM
contentsTruncated => res ¬ "contentsTruncated";
noProblem => res ¬ "noProblem";
ENDCASE => ERROR
};
}...