Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1001)

Unified Diff: build_tools/debug_server/debug_server/common/debug_blob.h

Issue 6312039: RSP proxy that can record session (for playback testing).... (Closed) Base URL: http://nativeclient-sdk.googlecode.com/svn/trunk/src/
Patch Set: Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: build_tools/debug_server/debug_server/common/debug_blob.h
===================================================================
--- build_tools/debug_server/debug_server/common/debug_blob.h (revision 0)
+++ build_tools/debug_server/debug_server/common/debug_blob.h (revision 0)
@@ -0,0 +1,39 @@
+#ifndef NACL_SDK_BUILD_TOOLS_DEBUG_SERVER_COMMON_DEBUG_BLOB_H_
+#define NACL_SDK_BUILD_TOOLS_DEBUG_SERVER_COMMON_DEBUG_BLOB_H_
+
+#include <deque>
+
+// Class for working with raw binary data.
+
+namespace debug {
+class Blob {
+ public:
+ Blob();
+ Blob(const Blob& other);
+ Blob(const void* buff, size_t buff_sz);
+ virtual ~Blob();
+ Blob& operator = (const Blob& other);
+ bool operator == (const Blob& other) const;
+
+ size_t Size() const;
+ char operator[] (size_t position) const;
+ char Front() const; // Returns first byte.
+ char Back() const; // Returns last byte.
+ char PopFront(); // Delete first byte.
+ char PopBack(); // Delete last byte.
+ void PushFront(char c); // Insert byte at beginning.
+ void PushBack(char c); // Add byte at the end.
+ void Clear();
+
+ std::string ToString() const;
+ std::string ToHexString() const;
+ void Append(const Blob& blob);
+ void Reverse();
+ bool Compare(const Blob& blob, size_t to_length = -1) const;
+ bool HasPrefix(const std::string& prefix) const;
+
+ protected:
+ std::deque<char> value_;
+};
+} // namespace debug
+#endif // NACL_SDK_BUILD_TOOLS_DEBUG_SERVER_COMMON_DEBUG_BLOB_H_

Powered by Google App Engine
This is Rietveld 408576698