• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

dart-lang / ffigen / 4364636722

pending completion
4364636722

Pull #527

github

GitHub
Merge 984472b2c into 1ac20ffd5
Pull Request #527: Bump dependencies and fix lints

21 of 21 new or added lines in 10 files covered. (100.0%)

3188 of 3452 relevant lines covered (92.35%)

24.67 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

77.78
/lib/src/code_generator/pointer.dart
1
// Copyright (c) 2022, 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
import 'package:ffigen/src/code_generator.dart';
6

7
import 'writer.dart';
8

9
/// Represents a pointer.
10
class PointerType extends Type {
11
  final Type child;
12
  PointerType(this.child);
23✔
13

14
  @override
23✔
15
  void addDependencies(Set<Binding> dependencies) {
16
    child.addDependencies(dependencies);
46✔
17
  }
18

19
  @override
22✔
20
  Type get baseType => child.baseType;
44✔
21

22
  @override
22✔
23
  String getCType(Writer w) =>
24
      '${w.ffiLibraryPrefix}.Pointer<${child.getCType(w)}>';
88✔
25

26
  @override
2✔
27
  String toString() => '$child*';
4✔
28

29
  @override
2✔
30
  String cacheKey() => '${child.cacheKey()}*';
6✔
31
}
32

33
/// Represents a constant array, which has a fixed size.
34
class ConstantArray extends PointerType {
35
  final int length;
36
  ConstantArray(this.length, Type child) : super(child);
16✔
37

38
  @override
7✔
39
  Type get baseArrayType => child.baseArrayType;
14✔
40

41
  @override
7✔
42
  bool get isIncompleteCompound => baseArrayType.isIncompleteCompound;
14✔
43

44
  @override
2✔
45
  String toString() => '$child[$length]';
6✔
46

47
  @override
2✔
48
  String cacheKey() => '${child.cacheKey()}[$length]';
8✔
49
}
50

51
/// Represents an incomplete array, which has an unknown size.
52
class IncompleteArray extends PointerType {
53
  IncompleteArray(Type child) : super(child);
6✔
54

55
  @override
×
56
  Type get baseArrayType => child.baseArrayType;
×
57

58
  @override
×
59
  String toString() => '$child[]';
×
60

61
  @override
×
62
  String cacheKey() => '${child.cacheKey()}[]';
×
63
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc