OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 docgen.models.indexable; | 5 library docgen.models.indexable; |
6 | 6 |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 | 8 |
9 import 'package:markdown/markdown.dart' as markdown; | 9 import 'package:markdown/markdown.dart' as markdown; |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 Library get owningLibrary => owner.owningLibrary; | 32 Library get owningLibrary => owner.owningLibrary; |
33 | 33 |
34 /// The reference to this element based on where it is printed as a | 34 /// The reference to this element based on where it is printed as a |
35 /// documentation file and also the unique URL to refer to this item. | 35 /// documentation file and also the unique URL to refer to this item. |
36 /// | 36 /// |
37 /// The qualified name (for URL purposes) and the file name are the same, | 37 /// The qualified name (for URL purposes) and the file name are the same, |
38 /// of the form packageName/ClassName or packageName/ClassName.methodName. | 38 /// of the form packageName/ClassName or packageName/ClassName.methodName. |
39 /// This defines both the URL and the directory structure. | 39 /// This defines both the URL and the directory structure. |
40 String get qualifiedName => packagePrefix + ownerPrefix + name; | 40 String get qualifiedName => packagePrefix + ownerPrefix + name; |
41 | 41 |
| 42 /// The name of the file we write this object's data into. The same as the |
| 43 /// qualified name but with leading colons (i.e. dart:) |
| 44 /// replaced by hyphens because of Windows. |
| 45 String get fileName => qualifiedName.replaceFirst(":", "-"); |
| 46 |
42 final TMirror mirror; | 47 final TMirror mirror; |
43 final bool isPrivate; | 48 final bool isPrivate; |
44 /// The comment text pre-resolution. We keep this around because inherited | 49 /// The comment text pre-resolution. We keep this around because inherited |
45 /// methods need to resolve links differently from the superclass. | 50 /// methods need to resolve links differently from the superclass. |
46 String unresolvedComment = ''; | 51 String unresolvedComment = ''; |
47 | 52 |
48 Indexable(TMirror mirror) | 53 Indexable(TMirror mirror) |
49 : this.mirror = mirror, | 54 : this.mirror = mirror, |
50 this.isPrivate = isHidden(mirror as DeclarationSourceMirror) { | 55 this.isPrivate = isHidden(mirror as DeclarationSourceMirror) { |
51 | 56 |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 /// Why two levels of lookup? Speed, man. Speed. | 212 /// Why two levels of lookup? Speed, man. Speed. |
208 final Map<String, Map<String, Indexable>> _mirrorToDocgen = | 213 final Map<String, Map<String, Indexable>> _mirrorToDocgen = |
209 new HashMap<String, Map<String, Indexable>>(); | 214 new HashMap<String, Map<String, Indexable>>(); |
210 | 215 |
211 Iterable<Indexable> get allIndexables => | 216 Iterable<Indexable> get allIndexables => |
212 _mirrorToDocgen.values.expand((map) => map.values); | 217 _mirrorToDocgen.values.expand((map) => map.values); |
213 | 218 |
214 Map<String, Indexable> lookupIndexableMap(DeclarationMirror mirror) { | 219 Map<String, Indexable> lookupIndexableMap(DeclarationMirror mirror) { |
215 return _mirrorToDocgen[dart2js_util.qualifiedNameOf(mirror)]; | 220 return _mirrorToDocgen[dart2js_util.qualifiedNameOf(mirror)]; |
216 } | 221 } |
OLD | NEW |