OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google, Inc. All Rights Reserved. | 2 * Copyright (C) 2013 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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 size_t totalCheckpointTokenCount() const { return m_totalCheckpointTokenCoun
t; } | 53 size_t totalCheckpointTokenCount() const { return m_totalCheckpointTokenCoun
t; } |
54 | 54 |
55 private: | 55 private: |
56 struct Checkpoint { | 56 struct Checkpoint { |
57 Checkpoint(const SegmentedString& i, size_t n, size_t t) : input(i), num
berOfSegmentsAlreadyAppended(n), tokensExtractedSincePreviousCheckpoint(t) { } | 57 Checkpoint(const SegmentedString& i, size_t n, size_t t) : input(i), num
berOfSegmentsAlreadyAppended(n), tokensExtractedSincePreviousCheckpoint(t) { } |
58 | 58 |
59 SegmentedString input; | 59 SegmentedString input; |
60 size_t numberOfSegmentsAlreadyAppended; | 60 size_t numberOfSegmentsAlreadyAppended; |
61 size_t tokensExtractedSincePreviousCheckpoint; | 61 size_t tokensExtractedSincePreviousCheckpoint; |
62 | 62 |
63 #ifndef NDEBUG | 63 #if ENABLE(ASSERT) |
64 bool isNull() const { return input.isEmpty() && !numberOfSegmentsAlready
Appended; } | 64 bool isNull() const { return input.isEmpty() && !numberOfSegmentsAlready
Appended; } |
65 #endif | 65 #endif |
66 void clear() { input.clear(); numberOfSegmentsAlreadyAppended = 0; token
sExtractedSincePreviousCheckpoint = 0;} | 66 void clear() { input.clear(); numberOfSegmentsAlreadyAppended = 0; token
sExtractedSincePreviousCheckpoint = 0;} |
67 }; | 67 }; |
68 | 68 |
69 SegmentedString m_current; | 69 SegmentedString m_current; |
70 Vector<String> m_segments; | 70 Vector<String> m_segments; |
71 Vector<Checkpoint> m_checkpoints; | 71 Vector<Checkpoint> m_checkpoints; |
72 | 72 |
73 // Note: These indicies may === vector.size(), in which case there are no va
lid checkpoints/segments at this time. | 73 // Note: These indicies may === vector.size(), in which case there are no va
lid checkpoints/segments at this time. |
74 size_t m_firstValidCheckpointIndex; | 74 size_t m_firstValidCheckpointIndex; |
75 size_t m_firstValidSegmentIndex; | 75 size_t m_firstValidSegmentIndex; |
76 size_t m_totalCheckpointTokenCount; | 76 size_t m_totalCheckpointTokenCount; |
77 | 77 |
78 void updateTotalCheckpointTokenCount(); | 78 void updateTotalCheckpointTokenCount(); |
79 }; | 79 }; |
80 | 80 |
81 } | 81 } |
82 | 82 |
83 #endif | 83 #endif |
OLD | NEW |