Add file::seek method
This commit is contained in:
parent
477ea95905
commit
d31715526a
1 changed files with 4 additions and 0 deletions
|
@ -41,6 +41,10 @@ namespace prism {
|
||||||
fread(t, s == 0 ? sizeof(T) : s, 1, handle);
|
fread(t, s == 0 ? sizeof(T) : s, 1, handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void seek(const size_t s) {
|
||||||
|
fseek(handle, s, SEEK_CUR);
|
||||||
|
}
|
||||||
|
|
||||||
/// Reads a string. Assumes the length is an unsigned integer.
|
/// Reads a string. Assumes the length is an unsigned integer.
|
||||||
void read_string(std::string& str) {
|
void read_string(std::string& str) {
|
||||||
unsigned int length = 0;
|
unsigned int length = 0;
|
||||||
|
|
Reference in a new issue