// September 2015 // Levee Patroller / Dijk Patrouille // This source file is (c) by Deltares. This source file is open source but only available to select users. Do not redistribute without written permission of Stichting Deltares, Delft, The Netherlands. // This header has been automatically generated. class XMLFileLog extends FileLog; //OpenLog("string") //CloseLog(); //static array for buffering the elements (max depth 10) var string buffer[10]; //counter of the number of elements in the array var int count; //number of spaces to make it look nice var string space; // We buffer the var string _totalbuffer; function string getBuffer() { return _totalbuffer; } function startDocument(string version, string type) { _totalbuffer = ""; Logf(_totalbuffer); } function startElement(string elm) { local string line; buffer[count]=elm; line = "<"$elm$">"; Logf(generateSpace()$line); _totalbuffer = _totalbuffer $ line; count++; } function writeAttribute(string att, string val) { local string line; if(count > 1) { line = "<"$att$">"$val$""; Logf(generateSpace()$line); _totalbuffer = _totalbuffer $ line; } } function endElement() { local string line; local string t; if(count > 0) { t = buffer[count-1]; count--; line = generateSpace()$""; Logf(line); _totalbuffer = _totalbuffer $ line; } } function string generateSpace() { local string t; local int i; for(i = 0; i < count; i++) { t = t$Chr(9); } return t; } defaultproperties { count = 0; }