Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
dart::bin::Platform Class Reference

#include <platform.h>

Static Public Member Functions

static bool Initialize ()
 
static int NumberOfProcessors ()
 
static const char * OperatingSystem ()
 
static const char * OperatingSystemVersion ()
 
static const char * HostArchitecture ()
 
static const char * LibraryPrefix ()
 
static const char * LibraryExtension ()
 
static bool LocalHostname (char *buffer, intptr_t buffer_length)
 
static const char * LocaleName ()
 
static char ** Environment (intptr_t *count)
 
static const char * ResolveExecutablePath ()
 
static intptr_t ResolveExecutablePathInto (char *result, size_t result_size)
 
static void SetExecutableName (const char *executable_name)
 
static const char * GetExecutableName ()
 
static const char * GetResolvedExecutableName ()
 
static void SetExecutableArguments (int script_index, char **argv)
 
static int GetScriptIndex ()
 
static char ** GetArgv ()
 
static void SetProcessName (const char *name)
 
static DART_NORETURN void Exit (int exit_code)
 
static DART_NORETURN void _Exit (int exit_code)
 
static void SetCoreDumpResourceLimit (int value)
 

Detailed Description

Definition at line 21 of file platform.h.

Member Function Documentation

◆ _Exit()

static DART_NORETURN void dart::bin::Platform::_Exit ( int  exit_code)
static

◆ Environment()

static char ** dart::bin::Platform::Environment ( intptr_t *  count)
static

◆ Exit()

static DART_NORETURN void dart::bin::Platform::Exit ( int  exit_code)
static

◆ GetArgv()

static char ** dart::bin::Platform::GetArgv ( )
inlinestatic

Definition at line 97 of file platform.h.

97{ return argv_; }

◆ GetExecutableName()

static const char * dart::bin::Platform::GetExecutableName ( )
static

◆ GetResolvedExecutableName()

static const char * dart::bin::Platform::GetResolvedExecutableName ( )
inlinestatic

Definition at line 75 of file platform.h.

75 {
76 if (resolved_executable_name_.load() == nullptr) {
77 // Try to resolve the executable path using platform specific APIs.
78 const char* resolved_name = Platform::ResolveExecutablePath();
79 if (resolved_name != nullptr) {
80 char* resolved_name_copy = Utils::StrDup(resolved_name);
81 const char* expect_old_is_null = nullptr;
82 if (!resolved_executable_name_.compare_exchange_strong(
83 expect_old_is_null, resolved_name_copy)) {
84 free(resolved_name_copy);
85 }
86 }
87 }
88 return resolved_executable_name_.load();
89 }
T load(std::memory_order order=std::memory_order_acquire) const
Definition atomic.h:101
bool compare_exchange_strong(T &expected, T desired, std::memory_order success_order=std::memory_order_acq_rel, std::memory_order failure_order=std::memory_order_acquire)
Definition atomic.h:129
static char * StrDup(const char *s)
static const char * ResolveExecutablePath()

◆ GetScriptIndex()

static int dart::bin::Platform::GetScriptIndex ( )
inlinestatic

Definition at line 96 of file platform.h.

96{ return script_index_; }

◆ HostArchitecture()

static const char * dart::bin::Platform::HostArchitecture ( )
inlinestatic

Definition at line 41 of file platform.h.

41{ return kHostArchitectureName; }

◆ Initialize()

static bool dart::bin::Platform::Initialize ( )
static

◆ LibraryExtension()

static const char * dart::bin::Platform::LibraryExtension ( )
static

◆ LibraryPrefix()

static const char * dart::bin::Platform::LibraryPrefix ( )
static

◆ LocaleName()

static const char * dart::bin::Platform::LocaleName ( )
static

◆ LocalHostname()

static bool dart::bin::Platform::LocalHostname ( char *  buffer,
intptr_t  buffer_length 
)
static

◆ NumberOfProcessors()

static int dart::bin::Platform::NumberOfProcessors ( )
static

◆ OperatingSystem()

static const char * dart::bin::Platform::OperatingSystem ( )
inlinestatic

Definition at line 32 of file platform.h.

32{ return kHostOperatingSystemName; }

◆ OperatingSystemVersion()

static const char * dart::bin::Platform::OperatingSystemVersion ( )
static

◆ ResolveExecutablePath()

static const char * dart::bin::Platform::ResolveExecutablePath ( )
static

◆ ResolveExecutablePathInto()

static intptr_t dart::bin::Platform::ResolveExecutablePathInto ( char *  result,
size_t  result_size 
)
static

◆ SetCoreDumpResourceLimit()

static void dart::bin::Platform::SetCoreDumpResourceLimit ( int  value)
static

◆ SetExecutableArguments()

static void dart::bin::Platform::SetExecutableArguments ( int  script_index,
char **  argv 
)
inlinestatic

Definition at line 92 of file platform.h.

92 {
93 script_index_ = script_index;
94 argv_ = argv;
95 }
char ** argv
Definition library.h:9

◆ SetExecutableName()

static void dart::bin::Platform::SetExecutableName ( const char *  executable_name)
inlinestatic

Definition at line 71 of file platform.h.

71 {
72 executable_name_ = executable_name;
73 }

◆ SetProcessName()

static void dart::bin::Platform::SetProcessName ( const char *  name)
static

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