Changeset 11:27c5b6c5425f

Show
Ignore:
Timestamp:
07/25/10 07:25:55 (2 years ago)
Author:
Jacob Carlborg <doob@me.com>
Tags:

0.0.1

branch:
default
Message:

Deserialization now works as well using D2. Compiles again with D1 and Tango. Cleaned up orange.util.io a bit.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • .hgignore

    r0 r11  
    1313main.d 
    1414main 
     15main.d.deps 
    1516*.framework 
    1617kandil 
  • orange/serialization/archives/XMLArchive.d

    r10 r11  
    88 
    99version (Tango) 
    10 { 
    11     /*import tango.text.xml.DocPrinter; 
    12     import tango.text.xml.Document;*/ 
    1310    import tango.util.Convert : to; 
    14 } 
    1511 
    1612else 
     
    348344         
    349345        auto tmp = getElement(Tags.objectTag, key, Attributes.keyAttribute, false); 
    350          
     346 
    351347        if (!tmp.isValid) 
    352348        { 
     
    489485     
    490486    private doc.Node getElement (DataType tag, DataType key, DataType attribute = Attributes.keyAttribute, bool throwOnError = true) 
    491     { 
     487    {       
    492488        auto set = lastElement.query[tag].attribute((doc.Node node) { 
    493489            if (node.name == attribute && node.value == key) 
     
    510506                    throw new ArchiveException(`Could not unarchive the value with the key "` ~ to!(string)(key) ~ `" due to malformed data.`, __FILE__, __LINE__); 
    511507            } 
    512              
     508 
    513509            return doc.Node.invalid; 
    514510        }        
  • orange/util/io.d

    r9 r11  
    4040     
    4141    else 
    42         foreach(t ; a) 
    43             write(t); 
     42        write(args); 
    4443} 
    4544 
     
    6463 
    6564    else 
    66     { 
    67         foreach(t ; args) 
    68             write(t); 
    69          
    70         write("\n"); 
    71     } 
     65        writeln(args); 
    7266} 
  • orange/xml/PhobosXML.d

    r10 r11  
    128128version (Phobos): 
    129129 
    130 import std.array; 
     130mixin(`import std.array; 
    131131import std.string; 
    132132import std.encoding; 
     
    140140    private tstring value_; 
    141141 
    142     this (tstring name, tstring value
     142    this (tstring name, tstring value, Element parent
    143143    { 
    144144        super(name); 
    145145        name_ = name; 
    146146        value_ = value; 
     147        parent_ = parent; 
    147148    } 
    148149 
     
    770771 
    771772        foreach (k, v ; tag.attr) 
    772             attrs ~= new Attribute(k, v);          
     773            attrs ~= new Attribute(k, v, this);            
    773774 
    774775        return attrs;            
     
    30453046        throw new XMLException(s); 
    30463047    } 
    3047 } 
    3048  
     3048}`); 
     3049