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

Unified Diff: base/pickle.h

Issue 11416150: Add support to Pickle for reading and writing floats (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix windows build Created 8 years, 1 month 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
« no previous file with comments | « no previous file | base/pickle.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/pickle.h
diff --git a/base/pickle.h b/base/pickle.h
index a92915f1e1c0d8c7c778bad71823726f332cccf6..cd587dec9ab17bfb7d275e5c99d4e4e5d337292b 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);
« no previous file with comments | « no previous file | base/pickle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698