| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 | 53 |
| 54 void setSeparator(const Vector<char>&); | 54 void setSeparator(const Vector<char>&); |
| 55 void setSeparator(const char*); | 55 void setSeparator(const char*); |
| 56 | 56 |
| 57 // Returns false when the end of the buffer was reached. | 57 // Returns false when the end of the buffer was reached. |
| 58 bool nextChunk(Vector<char>& data, bool includeSeparator = false); | 58 bool nextChunk(Vector<char>& data, bool includeSeparator = false); |
| 59 | 59 |
| 60 // Returns a null string when the end of the buffer has been reached. | 60 // Returns a null string when the end of the buffer has been reached. |
| 61 String nextChunkAsUTF8StringWithLatin1Fallback(bool includeSeparator = false); | 61 String nextChunkAsUTF8StringWithLatin1Fallback(bool includeSeparator = false); |
| 62 | 62 |
| 63 // Reads size bytes at the current location in the buffer, without changing th
e buffer position. | 63 // Reads size bytes at the current location in the buffer, without changing |
| 64 // Returns the number of bytes read. That number might be less than the specif
ied size if the end of the buffer was reached. | 64 // the buffer position. |
| 65 // Returns the number of bytes read. That number might be less than the |
| 66 // specified size if the end of the buffer was reached. |
| 65 size_t peek(Vector<char>&, size_t); | 67 size_t peek(Vector<char>&, size_t); |
| 66 | 68 |
| 67 private: | 69 private: |
| 68 RefPtr<const SharedBuffer> m_buffer; | 70 RefPtr<const SharedBuffer> m_buffer; |
| 69 size_t m_bufferPosition; | 71 size_t m_bufferPosition; |
| 70 const char* m_segment; | 72 const char* m_segment; |
| 71 size_t m_segmentLength; | 73 size_t m_segmentLength; |
| 72 size_t m_segmentIndex; | 74 size_t m_segmentIndex; |
| 73 bool m_reachedEndOfFile; | 75 bool m_reachedEndOfFile; |
| 74 Vector<char> m_separator; | 76 Vector<char> m_separator; |
| 75 size_t m_separatorIndex; | 77 size_t m_separatorIndex; |
| 76 }; | 78 }; |
| 77 | 79 |
| 78 } // namespace blink | 80 } // namespace blink |
| 79 | 81 |
| 80 #endif | 82 #endif |
| OLD | NEW |