| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #library("reader"); | 5 #library("reader"); |
| 6 | 6 |
| 7 #import("input_stream.dart"); | 7 #import("input_stream.dart"); |
| 8 #import("options.dart"); | 8 #import("options.dart"); |
| 9 #import("read_request.dart"); | 9 #import("read_request.dart"); |
| 10 #import("utils.dart"); | 10 #import("utils.dart"); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 id = _id; | 70 id = _id; |
| 71 return call(OPEN_MEMORY, id, [bytesForC(data)]); | 71 return call(OPEN_MEMORY, id, [bytesForC(data)]); |
| 72 }).transform((_) => new ArchiveInputStream(id)); | 72 }).transform((_) => new ArchiveInputStream(id)); |
| 73 } | 73 } |
| 74 | 74 |
| 75 /** | 75 /** |
| 76 * Creates an archive struct, applies all the configuration options to it, and | 76 * Creates an archive struct, applies all the configuration options to it, and |
| 77 * returns its id. | 77 * returns its id. |
| 78 */ | 78 */ |
| 79 Future<int> _createArchive() { | 79 Future<int> _createArchive() { |
| 80 return call(NEW, null).chain((id) { | 80 return call(NEW).chain((id) { |
| 81 if (id == 0 || id == null) { | 81 if (id == 0 || id == null) { |
| 82 throw new ArchiveException("Archive is invalid or closed."); | 82 throw new ArchiveException("Archive is invalid or closed."); |
| 83 } | 83 } |
| 84 return _pushConfiguration(id).transform((_) => id); | 84 return _pushConfiguration(id).transform((_) => id); |
| 85 }); | 85 }); |
| 86 } | 86 } |
| 87 | 87 |
| 88 /** | 88 /** |
| 89 * Applies all configuration in this archive to the archive identified by | 89 * Applies all configuration in this archive to the archive identified by |
| 90 * [id]. Returns a future that completes once all the configuration is | 90 * [id]. Returns a future that completes once all the configuration is |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 /** | 279 /** |
| 280 * Options for individual formats. See [the libarchive documentation][wiki] | 280 * Options for individual formats. See [the libarchive documentation][wiki] |
| 281 * for a list of available options. | 281 * for a list of available options. |
| 282 * | 282 * |
| 283 * [wiki]: https://github.com/libarchive/libarchive/wiki/ManPageArchiveReadSet
Options3 | 283 * [wiki]: https://github.com/libarchive/libarchive/wiki/ManPageArchiveReadSet
Options3 |
| 284 */ | 284 */ |
| 285 final ArchiveOptions options; | 285 final ArchiveOptions options; |
| 286 | 286 |
| 287 Format._() : options = new ArchiveOptions(); | 287 Format._() : options = new ArchiveOptions(); |
| 288 } | 288 } |
| OLD | NEW |