#include <dartutils.h>
Definition at line 42 of file dartutils.h.
◆ CommandLineOptions()
dart::bin::CommandLineOptions::CommandLineOptions |
( |
int |
max_count | ) |
|
|
inlineexplicit |
Definition at line 44 of file dartutils.h.
45 : count_(0), max_count_(
max_count), arguments_(
nullptr) {
48 if (arguments_ == nullptr) {
49 max_count_ = 0;
50 }
51 }
void * malloc(size_t size)
constexpr intptr_t kWordSize
◆ ~CommandLineOptions()
dart::bin::CommandLineOptions::~CommandLineOptions |
( |
| ) |
|
|
inline |
Definition at line 52 of file dartutils.h.
52 {
53 free(arguments_);
54 count_ = 0;
55 max_count_ = 0;
56 arguments_ = nullptr;
57 }
◆ AddArgument()
void dart::bin::CommandLineOptions::AddArgument |
( |
const char * |
argument | ) |
|
|
inline |
Definition at line 68 of file dartutils.h.
68 {
69 if (count_ < max_count_) {
70 arguments_[count_] = argument;
71 count_ += 1;
72 } else {
73 abort();
74 }
75 }
◆ AddArguments()
void dart::bin::CommandLineOptions::AddArguments |
( |
const char ** |
argv, |
|
|
int |
argc |
|
) |
| |
|
inline |
Definition at line 77 of file dartutils.h.
77 {
78 if (count_ + argc >= max_count_) {
79 abort();
80 }
81 for (
int i = 0;
i < argc; ++
i) {
82 arguments_[count_++] =
argv[
i];
83 }
84 }
◆ arguments()
const char ** dart::bin::CommandLineOptions::arguments |
( |
| ) |
const |
|
inline |
◆ count()
int dart::bin::CommandLineOptions::count |
( |
| ) |
const |
|
inline |
◆ CreateRuntimeOptions()
Dart_Handle dart::bin::CommandLineOptions::CreateRuntimeOptions |
( |
| ) |
|
Definition at line 58 of file dartutils.cc.
58 {
61 return string_type;
62 }
66 return dart_arguments;
67 }
68 for (
int i = 0;
i < count_;
i++) {
71 return argument_value;
72 }
76 }
77 }
78 return dart_arguments;
79}
const char * GetArgument(int index) const
static Dart_Handle NewString(const char *str)
static Dart_Handle GetDartType(const char *library_url, const char *class_name)
struct _Dart_Handle * Dart_Handle
DART_EXPORT Dart_Handle Dart_NewListOfTypeFilled(Dart_Handle element_type, Dart_Handle fill_object, intptr_t length)
DART_EXPORT Dart_Handle Dart_ListSetAt(Dart_Handle list, intptr_t index, Dart_Handle value)
DART_EXPORT bool Dart_IsError(Dart_Handle handle)
DART_EXPORT Dart_Handle Dart_EmptyString()
◆ GetArgument()
const char * dart::bin::CommandLineOptions::GetArgument |
( |
int |
index | ) |
const |
|
inline |
Definition at line 65 of file dartutils.h.
65 {
66 return (index >= 0 && index < count_) ? arguments_[index] : nullptr;
67 }
◆ max_count()
int dart::bin::CommandLineOptions::max_count |
( |
| ) |
const |
|
inline |
◆ operator delete()
void dart::bin::CommandLineOptions::operator delete |
( |
void * |
pointer | ) |
|
|
inline |
◆ Reset()
void dart::bin::CommandLineOptions::Reset |
( |
| ) |
|
|
inline |
The documentation for this class was generated from the following files: