MCPcopy Create free account
hub / github.com/apache/trafficserver / write_buffered_context

Function write_buffered_context

plugins/traffic_dump/json_utils.cc:64–71  ·  view source on GitHub ↗

Write the content of buf to jsonfile between prevIdx (inclusive) and idx (not * inclusive). * * This function is used to help deal with escaped characters with a low number * of write calls. This is meant to be used like so: the caller inspects every * character in a buffer, doing one of two things with each character: * * - The character does not need to be escaped. In this case, no call

Source from the content-addressed store, hash-verified

62 * @param[out] jsonfile The stream to conditionally write buffer content to.
63 */
64inline void
65write_buffered_context(char const *buf, int64_t &prevIdx, int64_t idx, std::ostream &jsonfile)
66{
67 if (prevIdx < idx) {
68 jsonfile.write(buf + prevIdx, idx - prevIdx);
69 }
70 prevIdx = idx + 1;
71}
72
73int
74esc_json_out(const char *buf, int64_t len, std::ostream &jsonfile)

Callers 1

esc_json_outFunction · 0.85

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected