| Index: ppapi/native_client/src/untrusted/nacl_ppapi_util/string_buffer.h
|
| diff --git a/ppapi/native_client/src/untrusted/nacl_ppapi_util/string_buffer.h b/ppapi/native_client/src/untrusted/nacl_ppapi_util/string_buffer.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..028e33030d4c887d1220a029da5a5e1740b5c0ed
|
| --- /dev/null
|
| +++ b/ppapi/native_client/src/untrusted/nacl_ppapi_util/string_buffer.h
|
| @@ -0,0 +1,36 @@
|
| +/*
|
| + * Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
| + * Use of this source code is governed by a BSD-style license that can be
|
| + * found in the LICENSE file.
|
| + */
|
| +
|
| +#ifndef NATIVE_CLIENT_TESTS_MANIFEST_FILE_STRING_BUFFER_H_
|
| +#define NATIVE_CLIENT_TESTS_MANIFEST_FILE_STRING_BUFFER_H_
|
| +
|
| +#include <string>
|
| +
|
| +#include <stdio.h>
|
| +#include <stdlib.h>
|
| +#include <inttypes.h>
|
| +
|
| +namespace nacl {
|
| +
|
| +class StringBuffer {
|
| + public:
|
| + StringBuffer();
|
| + ~StringBuffer();
|
| + void DiscardOutput();
|
| + void Printf(char const *fmt, ...) __attribute__((format(printf, 2, 3)));
|
| + std::string ToString() {
|
| + return std::string(buffer_, insert_);
|
| + }
|
| +
|
| + private:
|
| + size_t nbytes_;
|
| + size_t insert_;
|
| + char *buffer_;
|
| +};
|
| +
|
| +} // namespace nacl
|
| +
|
| +#endif
|
|
|