MCPcopy Create free account
hub / github.com/MaskRay/ccls / reflectMember

Function reflectMember

src/serializer.hh:292–300  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

290}
291
292template <typename T> void reflectMember(JsonWriter &vis, const char *name, std::optional<T> &v) {
293 // For TypeScript std::optional property key?: value in the spec,
294 // We omit both key and value if value is std::nullopt (null) for JsonWriter
295 // to reduce output. But keep it for other serialization formats.
296 if (v) {
297 vis.key(name);
298 reflect(vis, *v);
299 }
300}
301template <typename T> void reflectMember(BinaryWriter &vis, const char *, std::optional<T> &v) { reflect(vis, v); }
302
303// The same as std::optional

Callers 4

launchStdinFunction · 0.85
reflectHoverAndCommentsFunction · 0.85
reflectShortNameFunction · 0.85
reflectFunction · 0.85

Calls 4

keyMethod · 0.80
memberMethod · 0.80
reflectFunction · 0.70
validMethod · 0.45

Tested by

no test coverage detected