Flutter Engine
The Flutter Engine
SkJSONWriter.cpp
Go to the documentation of this file.
1/*
2 * Copyright 2017 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8// Make sure that the PRI format string macros are defined
9#ifndef __STDC_FORMAT_MACROS
10#define __STDC_FORMAT_MACROS
11#endif
12
14
15#include <inttypes.h>
16#include <stdarg.h>
17#include <stdio.h>
18
20 this->beginValue();
21 this->appendf("%" PRId64, value);
22}
23
25 this->beginValue();
26 this->appendf("%" PRIu64, value);
27}
28
30 this->beginValue();
31 this->appendf("\"0x%" PRIx64 "\"", value);
32}
33
34void SkJSONWriter::appendf(const char* fmt, ...) {
35 const int kBufferSize = 1024;
36 char buffer[kBufferSize];
37 va_list argp;
38 va_start(argp, fmt);
39#ifdef SK_BUILD_FOR_WIN
40 int length = _vsnprintf_s(buffer, kBufferSize, _TRUNCATE, fmt, argp);
41#else
42 int length = vsnprintf(buffer, kBufferSize, fmt, argp);
43#endif
45 va_end(argp);
46 this->write(buffer, length);
47}
#define SkASSERT(cond)
Definition: SkAssert.h:116
static const size_t kBufferSize
Definition: SkString.cpp:27
void appendU64(uint64_t value)
void appendS64(int64_t value)
void appendHexU64(uint64_t value)
uint8_t value
size_t length
va_start(args, format)
va_end(args)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
Definition: switches.h:126
static SkString fmt(SkColor4f c)
Definition: p3.cpp:43