Commit 6f1796f3 by apatrick@chromium.org

Make ProgramBinaries binary rather than text + binary.

Review URL: https://codereview.appspot.com/6351082 git-svn-id: https://angleproject.googlecode.com/svn/trunk@1215 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent dd8e4aa4
#define MAJOR_VERSION 1
#define MINOR_VERSION 0
#define BUILD_VERSION 0
#define BUILD_REVISION 1214
#define BUILD_REVISION 1215
#define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x)
......
......@@ -80,6 +80,11 @@ class BinaryInputStream
mOffset += length;
}
size_t offset() const
{
return mOffset;
}
bool error() const
{
return mError;
......@@ -132,29 +137,14 @@ class BinaryOutputStream
write(v.c_str(), length);
}
bool getData(void *buffer, size_t bufSize, size_t *length)
size_t length() const
{
if (bufSize < mData.size())
{
if (length)
{
*length = 0;
}
return false;
}
if (length)
{
*length = mData.size();
}
if (mData.size())
{
memcpy(buffer, &mData[0], mData.size());
}
return mData.size();
}
return true;
const void* data() const
{
return mData.size() ? &mData[0] : NULL;
}
private:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment