feat(fls): Java's view of the e-mail programs
The Java view now reads what FILIUS 2.14 keeps for its e-mail programs: the server's domain, switch and bean accounts with their mailboxes, and the accounts of /mailserver/konten.txt, which Java reads at every simulation start and which so win over the bean list; the client's three folders and address book, and its account from /konten.txt (no bean holds it). javaEmail.ts ports the bean setters and both file readers (stringZuListeBenutzerkonten, EmailKonto(String)); javaString.ts Java's trim, split and StringTokenizer; javaFileSystem.ts the file lookup, now shared with the DNS server, with the four non-ASCII units Java's equalsIgnoreCase also takes for an ASCII letter (measured over the BMP). Checked against Java on the corpus (the oracle dumps the e-mail state) and on 43 account files read by EmailServer.kontenLaden and EmailAnwendung.laden (EmailFileCases). Found: older files keep recipients as strings in the typed lists; a getter copy of the sender is filled and set back; one short server line makes Java throw for the whole file; a message with an empty text is lost on reading; a broken last client line empties the account. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
// java.lang.String and java.util.StringTokenizer as FILIUS's text formats
|
||||
// use them — each differs from its JavaScript namesake.
|
||||
|
||||
/** `String.trim()`: every UTF-16 unit up to U+0020 off both ends. */
|
||||
export function javaTrim(text: string): string {
|
||||
return text.replace(/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g, '');
|
||||
}
|
||||
|
||||
/**
|
||||
* `text.split(separator)` for a one-character separator: trailing empty
|
||||
* parts are dropped — "a;b;;".split(";") is two parts, ";;" none — but a
|
||||
* text without the separator is one part, even the empty text.
|
||||
*/
|
||||
export function javaSplit(text: string, separator: string): string[] {
|
||||
if (!text.includes(separator)) return [text];
|
||||
const parts = text.split(separator);
|
||||
while (parts.length > 0 && parts[parts.length - 1] === '') parts.pop();
|
||||
return parts;
|
||||
}
|
||||
|
||||
/** `new StringTokenizer(text, separator)`: the non-empty runs between separators. */
|
||||
export function javaTokens(text: string, separator: string): string[] {
|
||||
return text.split(separator).filter((token) => token !== '');
|
||||
}
|
||||
Reference in New Issue
Block a user