summaryrefslogtreecommitdiffstats
path: root/base/pickle.h
diff options
context:
space:
mode:
authorrbyers@chromium.org <rbyers@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-28 15:40:58 +0000
committerrbyers@chromium.org <rbyers@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-28 15:40:58 +0000
commitb1f61b03866ff2cccb0d9d07645d6780b719b0b9 (patch)
treea160789bccdf1da57ea8f444078ea1234aaf3f44 /base/pickle.h
parentba2dda7f10ddc4d5559c0e608d2f78e49a9bb5af (diff)
downloadchromium_src-b1f61b03866ff2cccb0d9d07645d6780b719b0b9.zip
chromium_src-b1f61b03866ff2cccb0d9d07645d6780b719b0b9.tar.gz
chromium_src-b1f61b03866ff2cccb0d9d07645d6780b719b0b9.tar.bz2
Add support to Pickle for reading and writing floats
BUG=136034 Review URL: https://chromiumcodereview.appspot.com/11416150 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@169957 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/pickle.h')
-rw-r--r--base/pickle.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/base/pickle.h b/base/pickle.h
index a92915f..cd587de 100644
--- a/base/pickle.h
+++ b/base/pickle.h
@@ -34,6 +34,7 @@ class BASE_EXPORT PickleIterator {
bool ReadUInt32(uint32* result) WARN_UNUSED_RESULT;
bool ReadInt64(int64* result) WARN_UNUSED_RESULT;
bool ReadUInt64(uint64* result) WARN_UNUSED_RESULT;
+ bool ReadFloat(float* result) WARN_UNUSED_RESULT;
bool ReadString(std::string* result) WARN_UNUSED_RESULT;
bool ReadWString(std::wstring* result) WARN_UNUSED_RESULT;
bool ReadString16(string16* result) WARN_UNUSED_RESULT;
@@ -158,6 +159,9 @@ class BASE_EXPORT Pickle {
bool ReadUInt64(PickleIterator* iter, uint64* result) const {
return iter->ReadUInt64(result);
}
+ bool ReadFloat(PickleIterator* iter, float* result) const {
+ return iter->ReadFloat(result);
+ }
bool ReadString(PickleIterator* iter, std::string* result) const {
return iter->ReadString(result);
}
@@ -218,6 +222,9 @@ class BASE_EXPORT Pickle {
bool WriteUInt64(uint64 value) {
return WriteBytes(&value, sizeof(value));
}
+ bool WriteFloat(float value) {
+ return WriteBytes(&value, sizeof(value));
+ }
bool WriteString(const std::string& value);
bool WriteWString(const std::wstring& value);
bool WriteString16(const string16& value);