Browse Source

add toString for Xml.XmlType enum abstract

Dan Korostelev 6 years ago
parent
commit
d8feb6f42b
1 changed files with 12 additions and 0 deletions
  1. 12 0
      std/Xml.hx

+ 12 - 0
std/Xml.hx

@@ -54,6 +54,18 @@ enum abstract XmlType(Int) {
 		Represents an XML document type.
 		Represents an XML document type.
 	**/
 	**/
 	var Document = 6;
 	var Document = 6;
+
+	public function toString():String {
+		return switch (cast this : XmlType) {
+			case Element: "Element";
+			case PCData: "PCData";
+			case CData: "CData";
+			case Comment: "Comment";
+			case DocType: "DocType";
+			case ProcessingInstruction: "ProcessingInstruction";
+			case Document: "Document";
+		};
+	}
 }
 }
 
 
 /**
 /**