return size of source from beginning or current position
| 43 | |
| 44 | // return size of source from beginning or current position |
| 45 | word32 FileSource::size(bool use_current) |
| 46 | { |
| 47 | long current = ftell(file_); |
| 48 | long begin = current; |
| 49 | |
| 50 | if (!use_current) { |
| 51 | fseek(file_, 0, SEEK_SET); |
| 52 | begin = ftell(file_); |
| 53 | } |
| 54 | |
| 55 | fseek(file_, 0, SEEK_END); |
| 56 | long end = ftell(file_); |
| 57 | |
| 58 | fseek(file_, current, SEEK_SET); |
| 59 | |
| 60 | return end - begin; |
| 61 | } |
| 62 | |
| 63 | |
| 64 | word32 FileSource::size_left() |
no outgoing calls