diff options
author | Nicolas Pennequin <nicolas.pennequin@free.fr> | 2008-07-11 16:51:25 +0000 |
---|---|---|
committer | Nicolas Pennequin <nicolas.pennequin@free.fr> | 2008-07-11 16:51:25 +0000 |
commit | ca5bb76d2b8f65aa97e50b633f828c1deb241526 (patch) | |
tree | 453a1b2de3a0dc0d0b2f7080d10d033bf8fbcdf1 /utils/zenutils/libraries/pelib-0.9/pelib/buffer/InputBuffer.h | |
parent | 141774be48940d56e3ad4dbf451d245b61d4f8b2 (diff) | |
download | rockbox-ca5bb76d2b8f65aa97e50b633f828c1deb241526.tar.gz rockbox-ca5bb76d2b8f65aa97e50b633f828c1deb241526.zip |
Delete the svn:executable property and set svn:eol-style to native for all those text files.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18012 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/zenutils/libraries/pelib-0.9/pelib/buffer/InputBuffer.h')
-rw-r--r--[-rwxr-xr-x] | utils/zenutils/libraries/pelib-0.9/pelib/buffer/InputBuffer.h | 104 |
1 files changed, 52 insertions, 52 deletions
diff --git a/utils/zenutils/libraries/pelib-0.9/pelib/buffer/InputBuffer.h b/utils/zenutils/libraries/pelib-0.9/pelib/buffer/InputBuffer.h index fc5a14e357..18a7b1b7bc 100755..100644 --- a/utils/zenutils/libraries/pelib-0.9/pelib/buffer/InputBuffer.h +++ b/utils/zenutils/libraries/pelib-0.9/pelib/buffer/InputBuffer.h | |||
@@ -1,52 +1,52 @@ | |||
1 | /* | 1 | /* |
2 | * InputBuffer.h - Part of the PeLib library. | 2 | * InputBuffer.h - Part of the PeLib library. |
3 | * | 3 | * |
4 | * Copyright (c) 2004 - 2005 Sebastian Porst (webmaster@the-interweb.com) | 4 | * Copyright (c) 2004 - 2005 Sebastian Porst (webmaster@the-interweb.com) |
5 | * All rights reserved. | 5 | * All rights reserved. |
6 | * | 6 | * |
7 | * This software is licensed under the zlib/libpng License. | 7 | * This software is licensed under the zlib/libpng License. |
8 | * For more details see http://www.opensource.org/licenses/zlib-license.php | 8 | * For more details see http://www.opensource.org/licenses/zlib-license.php |
9 | * or the license information file (license.htm) in the root directory | 9 | * or the license information file (license.htm) in the root directory |
10 | * of PeLib. | 10 | * of PeLib. |
11 | */ | 11 | */ |
12 | 12 | ||
13 | #ifndef INPUTBUFFER_H | 13 | #ifndef INPUTBUFFER_H |
14 | #define INPUTBUFFER_H | 14 | #define INPUTBUFFER_H |
15 | 15 | ||
16 | #include <vector> | 16 | #include <vector> |
17 | #include <iterator> | 17 | #include <iterator> |
18 | #include <cassert> | 18 | #include <cassert> |
19 | 19 | ||
20 | namespace PeLib | 20 | namespace PeLib |
21 | { | 21 | { |
22 | class InputBuffer | 22 | class InputBuffer |
23 | { | 23 | { |
24 | private: | 24 | private: |
25 | std::vector<unsigned char>& m_vBuffer; | 25 | std::vector<unsigned char>& m_vBuffer; |
26 | unsigned long ulIndex; | 26 | unsigned long ulIndex; |
27 | 27 | ||
28 | public: | 28 | public: |
29 | InputBuffer(std::vector<unsigned char>& vBuffer); | 29 | InputBuffer(std::vector<unsigned char>& vBuffer); |
30 | 30 | ||
31 | const unsigned char* data() const; | 31 | const unsigned char* data() const; |
32 | unsigned long size(); | 32 | unsigned long size(); |
33 | 33 | ||
34 | template<typename T> | 34 | template<typename T> |
35 | InputBuffer& operator>>(T& value) | 35 | InputBuffer& operator>>(T& value) |
36 | { | 36 | { |
37 | assert(ulIndex + sizeof(value) <= m_vBuffer.size()); | 37 | assert(ulIndex + sizeof(value) <= m_vBuffer.size()); |
38 | value = *(T*)(&m_vBuffer[ulIndex]);//reinterpret_cast<T*>(&m_vBuffer[ulIndex]); | 38 | value = *(T*)(&m_vBuffer[ulIndex]);//reinterpret_cast<T*>(&m_vBuffer[ulIndex]); |
39 | ulIndex += sizeof(T); | 39 | ulIndex += sizeof(T); |
40 | return *this; | 40 | return *this; |
41 | } | 41 | } |
42 | 42 | ||
43 | void read(char* lpBuffer, unsigned long ulSize); | 43 | void read(char* lpBuffer, unsigned long ulSize); |
44 | void reset(); | 44 | void reset(); |
45 | void set(unsigned long ulIndex); | 45 | void set(unsigned long ulIndex); |
46 | unsigned long get(); | 46 | unsigned long get(); |
47 | void setBuffer(std::vector<unsigned char>& vBuffer); | 47 | void setBuffer(std::vector<unsigned char>& vBuffer); |
48 | // void updateData(unsigned long ulIndex, | 48 | // void updateData(unsigned long ulIndex, |
49 | }; | 49 | }; |
50 | } | 50 | } |
51 | 51 | ||
52 | #endif | 52 | #endif |