| 98 | |
| 99 | |
| 100 | uint64 CFileDataIO::Seek(sint64 offset, wxSeekMode from) const |
| 101 | { |
| 102 | sint64 newpos = 0; |
| 103 | switch (from) { |
| 104 | case wxFromStart: |
| 105 | newpos = offset; |
| 106 | break; |
| 107 | |
| 108 | case wxFromCurrent: |
| 109 | newpos = GetPosition() + offset; |
| 110 | break; |
| 111 | |
| 112 | case wxFromEnd: |
| 113 | newpos = GetLength() + offset; |
| 114 | break; |
| 115 | |
| 116 | default: |
| 117 | MULE_VALIDATE_PARAMS(false, "Invalid seek-mode specified."); |
| 118 | } |
| 119 | |
| 120 | MULE_VALIDATE_PARAMS(newpos >= 0, "Position after seeking would be less than zero!"); |
| 121 | |
| 122 | sint64 result = doSeek(newpos); |
| 123 | MULE_VALIDATE_STATE(result >= 0, "Seeking resulted in invalid offset."); |
| 124 | MULE_VALIDATE_STATE(result == newpos, "Target position and actual position disagree."); |
| 125 | |
| 126 | return result; |
| 127 | } |
| 128 | |
| 129 | |
| 130 | uint8 CFileDataIO::ReadUInt8() const |
no outgoing calls