239 {
240
241inline int StrLength(
const char*
string) {
242 size_t length = strlen(
string);
244 return static_cast<int>(
length);
245}
246
247
248template <typename T>
249class Vector {
250 public:
252 Vector(
T* data,
int len) : start_(
data), length_(
len) {
254 }
255
256
257
258 Vector<T> SubVector(int from, int to) {
262 return Vector<T>(
start() + from, to - from);
263 }
264
265
266 int length()
const {
return length_; }
267
268
269 bool is_empty()
const {
return length_ == 0; }
270
271
272 T*
start()
const {
return start_; }
273
274
275 T& operator[](
int index)
const {
277 return start_[index];
278 }
279
280 T& first() {
return start_[0]; }
281
282 T& last() {
return start_[length_ - 1]; }
283
284 void pop_back() {
286 --length_;
287 }
288
289 private:
291 int length_;
292};
293
294
295
296
297
298class StringBuilder {
299 public:
302
303 ~StringBuilder() { if (!is_finalized()) Finalize(); }
304
305 int size()
const {
return buffer_.length(); }
306
307
308 int position() const {
310 return position_;
311 }
312
313
314 void Reset() { position_ = 0; }
315
316
317
318
319 void AddCharacter(char c) {
322 buffer_[position_++] = c;
323 }
324
325
326
327 void AddString(
const char*
s) {
329 }
330
331
332
333 void AddSubstring(
const char*
s,
int n) {
336 memmove(&buffer_[position_],
s,
static_cast<size_t>(n));
337 position_ += n;
338 }
339
340
341
342
343 void AddPadding(
char c,
int count) {
344 for (
int i = 0; i <
count; i++) {
345 AddCharacter(c);
346 }
347 }
348
349
350 char* Finalize() {
352 buffer_[position_] = '\0';
353
354
356 position_ = -1;
358 return buffer_.start();
359 }
360
361 private:
362 Vector<char> buffer_;
363 int position_;
364
365 bool is_finalized() const { return position_ < 0; }
366
368};
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394template <class Dest, class Source>
396
397
398#if __cplusplus >= 201103L
399 static_assert(sizeof(Dest) == sizeof(Source),
400 "source and destination size mismatch");
401#else
403 typedef char VerifySizesAreEqual[sizeof(Dest) == sizeof(Source) ? 1 : -1];
404#endif
405
407 memmove(&dest, &
source,
sizeof(dest));
409}
410
411template <class Dest, class Source>
413 return BitCast<Dest>(
reinterpret_cast<uintptr_t
>(
source));
414}
415
416}
417
418#endif
static uint32_t buffer_size(uint32_t offset, uint32_t maxAlignment)
static void is_empty(skiatest::Reporter *reporter, const SkPath &p)
static const uint8_t buffer[]
Dest BitCast(const Source &source)
int StrLength(const char *string)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
#define DOUBLE_CONVERSION_NULLPTR
#define DOUBLE_CONVERSION_UNUSED
#define DOUBLE_CONVERSION_ASSERT(condition)
#define DOUBLE_CONVERSION_DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName)