tom_d4rt_cli_api library
Export barrel for D4rt CLI API.
This barrel exports all types needed for the cli global variable
and is used by the bridge generator.
Usage:
import 'package:tom_d4rt_dcli/tom_d4rt_cli_api.dart';
void main() async {
cli.cd('/project');
await cli.replay('setup.d4rt');
final classes = cli.classes();
}
Classes
- CliGlobalHolder
- Holder for the cli global variable.
- CliRuntime
- Provides access to process and platform runtime information.
- CliRuntimeImpl
- Default implementation of CliRuntime using dart:io Platform and Directory.
- CliState
- Pure state container for CLI operations.
- ContextStack
- Manages the execution context stack.
- D4rtCliApi
- Programmatic interface to D4rt CLI functionality.
- D4rtCliController
- Implementation of D4rtCliApi that handles all CLI operations.
- ExecuteResult
- Result of code execution.
- ExecutionContext
- Represents a single execution context in the context stack.
- ImportInfo
- Information about an import.
- SymbolInfo
- Detailed symbol information.
Enums
- MultilineMode
- Multiline input mode for accumulated code blocks.
- SymbolKind
- Kind of symbol.
Constants
- cliLibrary → const String
- The library URI for CLI API exports.
Properties
- cliGlobalHolder → CliGlobalHolder
-
Global holder for the CLI controller.
final
-
verificationFailures
→ List<
String> -
Get the list of verification failures.
no setter
Functions
-
clearVerificationFailures(
) → void - Clear all verification failures.
-
registerCliBridge(
D4rt d4rt) → void -
Registers the
cliglobal variable with D4rt. -
registerCliShortcuts(
D4rt d4rt) → void - Registers the CLI API methods as global functions for convenience.
-
testSummary(
) → bool - Print a test summary.
-
verify(
bool condition, String errorMessage) → bool - Verify that a condition is true.
-
verifyContains(
String actual, String substring, [String? message]) → bool - Verify that a string contains a substring.
-
verifyEquals(
Object? actual, Object? expected, [String? message]) → bool - Verify that two values are equal.
-
verifyLength(
List list, int length, [String? message]) → bool - Verify that a list has a specific length.
-
verifyMatches(
String actual, String pattern, [String? message]) → bool - Verify that a string matches a regular expression.
-
verifyNotEmpty(
List list, [String? message]) → bool - Verify that a list is not empty.
-
verifyNotNull(
Object? value, [String? message]) → bool - Verify that a value is not null.
-
verifyNull(
Object? value, [String? message]) → bool - Verify that a value is null.
-
verifyThrows(
void fn(), [String? message]) → bool - Verify that a condition throws an exception.
Exceptions / Errors
- CliException
- Base exception for CLI operations.
- CliFileNotFoundException
- File not found during execution.
- CliNotInitializedException
- Thrown when accessing cli global before initialization.
- DirectoryNotFoundException
- Directory not found during navigation.
- ExecutionException
- Error during code execution.
- InvalidMultilineModeException
- Thrown when a method is called that is invalid in the current multiline mode.
- MaxNestingDepthException
- Thrown when maximum nesting depth is exceeded.
- ReplayException
- Error during replay file execution.
- VerificationFailure
- Exception thrown when a verification fails.