diff orange/serialization/archives/XMLArchive.d @ 35:511d1ef4e299 experimental

Now all unit tests pass on latest DMD2 compiler.
author Jacob Carlborg <doob@me.com>
date Wed, 03 Aug 2011 21:44:11 +0200
parents 068e853b9c07
children 6f35fb47ca24
line wrap: on
line diff
--- a/orange/serialization/archives/XMLArchive.d	Mon Aug 01 20:34:54 2011 +0200
+++ b/orange/serialization/archives/XMLArchive.d	Wed Aug 03 21:44:11 2011 +0200
@@ -537,22 +537,22 @@
 	{
 		return restore!(Id)(lastElement) in {			
 			auto element = getElement(Tags.arrayTag, key);
-			
+
 			if (!element.isValid)
 				return Id.max;
-	
+
 			lastElement = element;
 			auto len = getValueOfAttribute(Attributes.lengthAttribute);
-			
+
 			if (!len)
 				return Id.max;
-			
+
 			auto length = fromData!(size_t)(len);
 			auto id = getValueOfAttribute(Attributes.idAttribute);	
-			
+
 			if (!id)
 				return Id.max;
-			
+
 			dg(length);
 			
 			return toId(id);
@@ -690,7 +690,11 @@
 	
 	wchar unarchiveEnumWchar (string key)
 	{
-		return unarchiveEnum!(wchar)(key);
+		version (Tango)
+			return unarchiveEnum!(wchar)(key);
+			
+		else
+			return wchar.init;
 	}	
 	
 	private T unarchiveEnum (T) (string key)
@@ -727,7 +731,7 @@
 			if (!stringId)
 				return;
 
-			id = stringId.toId();
+			id = toId(stringId);
 			result = newInstance(name);
 			dg();
 		};
@@ -752,7 +756,7 @@
 			
 			dg();
 			
-			return id.toId();
+			return toId(id);
 		};
 	}
 	
@@ -846,7 +850,7 @@
 		if (!stringId)
 			return T.init;
 
-		id = stringId.toId();
+		id = toId(stringId);
 		return value;
 	}
 	
@@ -995,7 +999,11 @@
 	
 	wchar unarchiveWchar (string key)
 	{
-		return unarchivePrimitive!(wchar)(key);
+		version (Tango)
+			return unarchivePrimitive!(wchar)(key);
+			
+		else
+			return wchar.init;
 	}
 	
 	T unarchivePrimitive (T) (string key)