OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 void setUint32(unsigned byteOffset, uint32_t value, bool littleEndian, Excep
tionCode&); | 68 void setUint32(unsigned byteOffset, uint32_t value, bool littleEndian, Excep
tionCode&); |
69 void setFloat32(unsigned byteOffset, float value, ExceptionCode& ec) { setFl
oat32(byteOffset, value, false, ec); } | 69 void setFloat32(unsigned byteOffset, float value, ExceptionCode& ec) { setFl
oat32(byteOffset, value, false, ec); } |
70 void setFloat32(unsigned byteOffset, float value, bool littleEndian, Excepti
onCode&); | 70 void setFloat32(unsigned byteOffset, float value, bool littleEndian, Excepti
onCode&); |
71 void setFloat64(unsigned byteOffset, double value, ExceptionCode& ec) { setF
loat64(byteOffset, value, false, ec); } | 71 void setFloat64(unsigned byteOffset, double value, ExceptionCode& ec) { setF
loat64(byteOffset, value, false, ec); } |
72 void setFloat64(unsigned byteOffset, double value, bool littleEndian, Except
ionCode&); | 72 void setFloat64(unsigned byteOffset, double value, bool littleEndian, Except
ionCode&); |
73 | 73 |
74 private: | 74 private: |
75 DataView(PassRefPtr<ArrayBuffer>, unsigned byteOffset, unsigned byteLength); | 75 DataView(PassRefPtr<ArrayBuffer>, unsigned byteOffset, unsigned byteLength); |
76 | 76 |
77 template<typename T> | 77 template<typename T> |
78 inline bool beyondRange(unsigned byteOffset) const { return byteOffset + siz
eof(T) > m_byteLength; } | 78 inline bool beyondRange(unsigned byteOffset) const { return byteOffset >= m_
byteLength || byteOffset + sizeof(T) > m_byteLength; } |
79 | 79 |
80 template<typename T> | 80 template<typename T> |
81 T getData(unsigned byteOffset, bool littleEndian, ExceptionCode&) const; | 81 T getData(unsigned byteOffset, bool littleEndian, ExceptionCode&) const; |
82 | 82 |
83 template<typename T> | 83 template<typename T> |
84 void setData(unsigned byteOffset, T value, bool littleEndian, ExceptionCode&
); | 84 void setData(unsigned byteOffset, T value, bool littleEndian, ExceptionCode&
); |
85 | 85 |
86 unsigned m_byteLength; | 86 unsigned m_byteLength; |
87 }; | 87 }; |
88 | 88 |
89 | 89 |
90 } // namespace WebCore | 90 } // namespace WebCore |
91 | 91 |
92 #endif // DataView_h | 92 #endif // DataView_h |
OLD | NEW |