Flutter Engine
The Flutter Engine
Classes | Public Types | Static Public Member Functions | List of all members
dart::bin::DartDevIsolate Class Reference

#include <dartdev_isolate.h>

Classes

class  DartDevRunner
 

Public Types

enum  DartDev_Result { DartDev_Result_Unknown = -1 , DartDev_Result_Run = 1 , DartDev_Result_Exit = 2 }
 

Static Public Member Functions

static bool ShouldParseCommand (const char *script_uri)
 
static void set_should_run_dart_dev (bool enable)
 
static void PrintUsageErrorOnRun ()
 
static bool should_run_dart_dev ()
 
static CStringUniquePtr TryResolveDartDevSnapshotPath ()
 
static DartDev_Result RunDartDev (Dart_IsolateGroupCreateCallback create_isolate, char **packages_file, char **script, CommandLineOptions *dart_options)
 

Detailed Description

Definition at line 25 of file dartdev_isolate.h.

Member Enumeration Documentation

◆ DartDev_Result

Enumerator
DartDev_Result_Unknown 
DartDev_Result_Run 
DartDev_Result_Exit 

Definition at line 28 of file dartdev_isolate.h.

Member Function Documentation

◆ PrintUsageErrorOnRun()

static void dart::bin::DartDevIsolate::PrintUsageErrorOnRun ( )
inlinestatic

Definition at line 42 of file dartdev_isolate.h.

42 {
44 print_usage_error_ = true;
45 }
static void set_should_run_dart_dev(bool enable)

◆ RunDartDev()

DartDevIsolate::DartDev_Result dart::bin::DartDevIsolate::RunDartDev ( Dart_IsolateGroupCreateCallback  create_isolate,
char **  packages_file,
char **  script,
CommandLineOptions dart_options 
)
static

Definition at line 317 of file dartdev_isolate.cc.

321 {
322 runner_.Run(create_isolate, packages_file, script, dart_options);
323 return runner_.result();
324}
void Run(Dart_IsolateGroupCreateCallback create_isolate, char **package_config_override_, char **script, CommandLineOptions *dart_options)

◆ set_should_run_dart_dev()

static void dart::bin::DartDevIsolate::set_should_run_dart_dev ( bool  enable)
inlinestatic

Definition at line 38 of file dartdev_isolate.h.

38 {
39 should_run_dart_dev_ = enable;
40 }

◆ should_run_dart_dev()

static bool dart::bin::DartDevIsolate::should_run_dart_dev ( )
inlinestatic

Definition at line 47 of file dartdev_isolate.h.

47{ return should_run_dart_dev_; }

◆ ShouldParseCommand()

bool dart::bin::DartDevIsolate::ShouldParseCommand ( const char *  script_uri)
static

Definition at line 51 of file dartdev_isolate.cc.

51 {
52 // If script_uri is a known DartDev command, we should not try to run it.
53 //
54 // Otherwise if script_uri is not a file path or of a known URI scheme, we
55 // assume this is a mistyped DartDev command.
56 //
57 // This should be kept in sync with the commands in
58 // `pkg/dartdev/lib/dartdev.dart`.
59 return (
60 (strcmp(script_uri, "analyze") == 0) ||
61 (strcmp(script_uri, "compilation-server") == 0) ||
62 (strcmp(script_uri, "build") == 0) ||
63 (strcmp(script_uri, "compile") == 0) ||
64 (strcmp(script_uri, "create") == 0) ||
65 (strcmp(script_uri, "development-service") == 0) ||
66 (strcmp(script_uri, "devtools") == 0) ||
67 (strcmp(script_uri, "doc") == 0) || (strcmp(script_uri, "fix") == 0) ||
68 (strcmp(script_uri, "format") == 0) ||
69 (strcmp(script_uri, "info") == 0) || (strcmp(script_uri, "pub") == 0) ||
70 (strcmp(script_uri, "run") == 0) || (strcmp(script_uri, "test") == 0) ||
71 (strcmp(script_uri, "info") == 0) ||
72 (strcmp(script_uri, "language-server") == 0) ||
73 (strcmp(script_uri, "tooling-daemon") == 0) ||
74 (!File::ExistsUri(nullptr, script_uri) &&
75 (strncmp(script_uri, "http://", 7) != 0) &&
76 (strncmp(script_uri, "https://", 8) != 0) &&
77 (strncmp(script_uri, "file://", 7) != 0) &&
78 (strncmp(script_uri, "package:", 8) != 0) &&
79 (strncmp(script_uri, "google3://", 10) != 0)));
80}
static bool ExistsUri(Namespace *namespc, const char *uri)

◆ TryResolveDartDevSnapshotPath()

CStringUniquePtr dart::bin::DartDevIsolate::TryResolveDartDevSnapshotPath ( )
static

Definition at line 116 of file dartdev_isolate.cc.

116 {
117 return TryResolveArtifactPath("dartdev.dart.snapshot");
118}

The documentation for this class was generated from the following files: