aboutsummaryrefslogtreecommitdiff
path: root/src/processor/binarystream.h
diff options
context:
space:
mode:
authorivan.penkov@gmail.com <ivan.penkov@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e>2012-06-28 22:46:01 +0000
committerivan.penkov@gmail.com <ivan.penkov@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e>2012-06-28 22:46:01 +0000
commit6de969a3040fa31ba60302c66613d1d2e6f5a730 (patch)
treeaad9de34e00834709440f01cb0f54e315989490e /src/processor/binarystream.h
parentFix Android build of client library (diff)
downloadbreakpad-6de969a3040fa31ba60302c66613d1d2e6f5a730.tar.xz
This change allows compiling the google-breakpad code using a global ::string class instead of std::string. For more details take a look at common/using_std_string.h
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@974 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/processor/binarystream.h')
-rw-r--r--src/processor/binarystream.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/processor/binarystream.h b/src/processor/binarystream.h
index 8769c250..04657150 100644
--- a/src/processor/binarystream.h
+++ b/src/processor/binarystream.h
@@ -28,8 +28,8 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// binarystream implements part of the std::iostream interface as a
-// wrapper around std::stringstream to allow reading and writing
-// std::string and integers of known size.
+// wrapper around std::stringstream to allow reading and writing strings
+// and integers of known size.
#ifndef GOOGLE_BREAKPAD_PROCESSOR_BINARYSTREAM_H_
#define GOOGLE_BREAKPAD_PROCESSOR_BINARYSTREAM_H_
@@ -37,6 +37,7 @@
#include <sstream>
#include <string>
+#include "common/using_std_string.h"
#include "google_breakpad/common/breakpad_types.h"
namespace google_breakpad {
@@ -47,21 +48,21 @@ class binarystream {
public:
explicit binarystream(ios_base::openmode which = ios_base::out|ios_base::in)
: stream_(which) {}
- explicit binarystream(const std::string &str,
+ explicit binarystream(const string &str,
ios_base::openmode which = ios_base::out|ios_base::in)
: stream_(str, which) {}
explicit binarystream(const char *str, size_t size,
ios_base::openmode which = ios_base::out|ios_base::in)
- : stream_(std::string(str, size), which) {}
+ : stream_(string(str, size), which) {}
- binarystream &operator>>(std::string &str);
+ binarystream &operator>>(string &str);
binarystream &operator>>(u_int8_t &u8);
binarystream &operator>>(u_int16_t &u16);
binarystream &operator>>(u_int32_t &u32);
binarystream &operator>>(u_int64_t &u64);
// Note: strings are truncated at 65535 characters
- binarystream &operator<<(const std::string &str);
+ binarystream &operator<<(const string &str);
binarystream &operator<<(u_int8_t u8);
binarystream &operator<<(u_int16_t u16);
binarystream &operator<<(u_int32_t u32);
@@ -70,8 +71,8 @@ class binarystream {
// Forward a few methods directly from the stream object
bool eof() const { return stream_.eof(); }
void clear() { stream_.clear(); }
- std::string str() const { return stream_.str(); }
- void str(const std::string &s) { stream_.str(s); }
+ string str() const { return stream_.str(); }
+ void str(const string &s) { stream_.str(s); }
// Seek both read and write pointers to the beginning of the stream.
void rewind() {