| 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_
|
|
|