mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-06 06:33:24 +00:00
Add method raw_fd_ostream::seek() for random access within a file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63044 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4699934647
commit
9c27886dd5
@ -182,6 +182,10 @@ public:
|
|||||||
uint64_t tell() {
|
uint64_t tell() {
|
||||||
return pos + (OutBufCur - OutBufStart);
|
return pos + (OutBufCur - OutBufStart);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// seek - Flushes the stream and repositions the underlying file descriptor
|
||||||
|
/// positition to the offset specified from the beginning of the file.
|
||||||
|
uint64_t seek(uint64_t off);
|
||||||
};
|
};
|
||||||
|
|
||||||
/// raw_stdout_ostream - This is a stream that always prints to stdout.
|
/// raw_stdout_ostream - This is a stream that always prints to stdout.
|
||||||
|
@ -255,6 +255,12 @@ void raw_fd_ostream::close() {
|
|||||||
FD = -1;
|
FD = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint64_t raw_fd_ostream::seek(uint64_t off) {
|
||||||
|
flush();
|
||||||
|
pos = lseek(FD, off, SEEK_SET);
|
||||||
|
return pos;
|
||||||
|
}
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// raw_stdout/err_ostream
|
// raw_stdout/err_ostream
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
Loading…
x
Reference in New Issue
Block a user