|
| 1 | +// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file |
| 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. |
| 4 | + |
| 5 | +/// The migration information associated with a single library. |
| 6 | +class LibraryInfo { |
| 7 | + /// The information about the units in the library. The information about the |
| 8 | + /// defining compilation unit is always first. |
| 9 | + final List<UnitInfo> units; |
| 10 | + |
| 11 | + /// Initialize a newly created library. |
| 12 | + LibraryInfo(this.units); |
| 13 | +} |
| 14 | + |
| 15 | +/// A description of an explanation associated with a region of code that was |
| 16 | +/// modified. |
| 17 | +class RegionInfo { |
| 18 | + /// The offset to the beginning of the region. |
| 19 | + final int offset; |
| 20 | + |
| 21 | + /// The length of the region. |
| 22 | + final int length; |
| 23 | + |
| 24 | + /// The explanation to be displayed for the region. |
| 25 | + final String explanation; |
| 26 | + |
| 27 | + /// Initialize a newly created region. |
| 28 | + RegionInfo(this.offset, this.length, this.explanation); |
| 29 | +} |
| 30 | + |
| 31 | +/// The migration information associated with a single compilation unit. |
| 32 | +class UnitInfo { |
| 33 | + /// The absolute and normalized path of the unit. |
| 34 | + final String path; |
| 35 | + |
| 36 | + /// The content of unit. |
| 37 | + final String content; |
| 38 | + |
| 39 | + /// The information about the regions that have an explanation associated with |
| 40 | + /// them. |
| 41 | + final List<RegionInfo> regions; |
| 42 | + |
| 43 | + /// Initialize a newly created unit. |
| 44 | + UnitInfo(this.path, this.content, this.regions); |
| 45 | +} |
0 commit comments