Changeset 11:27c5b6c5425f
- 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
| r0 |
r11 |
|
| 13 | 13 | main.d |
|---|
| 14 | 14 | main |
|---|
| | 15 | main.d.deps |
|---|
| 15 | 16 | *.framework |
|---|
| 16 | 17 | kandil |
|---|
| r10 |
r11 |
|
| 8 | 8 | |
|---|
| 9 | 9 | version (Tango) |
|---|
| 10 | | { |
|---|
| 11 | | /*import tango.text.xml.DocPrinter; |
|---|
| 12 | | import tango.text.xml.Document;*/ |
|---|
| 13 | 10 | import tango.util.Convert : to; |
|---|
| 14 | | } |
|---|
| 15 | 11 | |
|---|
| 16 | 12 | else |
|---|
| … | … | |
| 348 | 344 | |
|---|
| 349 | 345 | auto tmp = getElement(Tags.objectTag, key, Attributes.keyAttribute, false); |
|---|
| 350 | | |
|---|
| | 346 | |
|---|
| 351 | 347 | if (!tmp.isValid) |
|---|
| 352 | 348 | { |
|---|
| … | … | |
| 489 | 485 | |
|---|
| 490 | 486 | private doc.Node getElement (DataType tag, DataType key, DataType attribute = Attributes.keyAttribute, bool throwOnError = true) |
|---|
| 491 | | { |
|---|
| | 487 | { |
|---|
| 492 | 488 | auto set = lastElement.query[tag].attribute((doc.Node node) { |
|---|
| 493 | 489 | if (node.name == attribute && node.value == key) |
|---|
| … | … | |
| 510 | 506 | throw new ArchiveException(`Could not unarchive the value with the key "` ~ to!(string)(key) ~ `" due to malformed data.`, __FILE__, __LINE__); |
|---|
| 511 | 507 | } |
|---|
| 512 | | |
|---|
| | 508 | |
|---|
| 513 | 509 | return doc.Node.invalid; |
|---|
| 514 | 510 | } |
|---|
| r9 |
r11 |
|
| 40 | 40 | |
|---|
| 41 | 41 | else |
|---|
| 42 | | foreach(t ; a) |
|---|
| 43 | | write(t); |
|---|
| | 42 | write(args); |
|---|
| 44 | 43 | } |
|---|
| 45 | 44 | |
|---|
| … | … | |
| 64 | 63 | |
|---|
| 65 | 64 | else |
|---|
| 66 | | { |
|---|
| 67 | | foreach(t ; args) |
|---|
| 68 | | write(t); |
|---|
| 69 | | |
|---|
| 70 | | write("\n"); |
|---|
| 71 | | } |
|---|
| | 65 | writeln(args); |
|---|
| 72 | 66 | } |
|---|
| r10 |
r11 |
|
| 128 | 128 | version (Phobos): |
|---|
| 129 | 129 | |
|---|
| 130 | | import std.array; |
|---|
| | 130 | mixin(`import std.array; |
|---|
| 131 | 131 | import std.string; |
|---|
| 132 | 132 | import std.encoding; |
|---|
| … | … | |
| 140 | 140 | private tstring value_; |
|---|
| 141 | 141 | |
|---|
| 142 | | this (tstring name, tstring value) |
|---|
| | 142 | this (tstring name, tstring value, Element parent) |
|---|
| 143 | 143 | { |
|---|
| 144 | 144 | super(name); |
|---|
| 145 | 145 | name_ = name; |
|---|
| 146 | 146 | value_ = value; |
|---|
| | 147 | parent_ = parent; |
|---|
| 147 | 148 | } |
|---|
| 148 | 149 | |
|---|
| … | … | |
| 770 | 771 | |
|---|
| 771 | 772 | foreach (k, v ; tag.attr) |
|---|
| 772 | | attrs ~= new Attribute(k, v); |
|---|
| | 773 | attrs ~= new Attribute(k, v, this); |
|---|
| 773 | 774 | |
|---|
| 774 | 775 | return attrs; |
|---|
| … | … | |
| 3045 | 3046 | throw new XMLException(s); |
|---|
| 3046 | 3047 | } |
|---|
| 3047 | | } |
|---|
| 3048 | | |
|---|
| | 3048 | }`); |
|---|
| | 3049 | |
|---|