69 const char example[] =
"123456789012345678901234567890";
75 FILE *fp = ::fopen(filename.c_str(),
"w+b");
76 (void)::
remove(filename.c_str());
81 ::fwrite(example,
sizeof(example), 1, fp);
95 reader.
read(document);
97 for (
size_t index = 0; index < document.
contents.
size(); index++)
103 puts(
"instream_file_star::PASSED");
instream_file_star(FILE *file)
Constructor.
Definition: instream_file_star.h:39
C++ slices (string-descriptors)
Definition: slice.h:27
Container class representing a document through the indexing pipeline.
Definition: document.h:31
static void unittest(void)
Unit test this class.
Definition: instream_file_star.h:64
Subclass of the instream_file class used for reading data from a disk file that already exists (e...
Definition: instream_file_star.h:28
#define JASS_assert(expression)
Drop in replacement for assert() that aborts in Release as well as Debug.
Definition: asserts.h:33
virtual ~instream_file_star()
Destructior.
Definition: instream_file_star.h:52
Subclass of the instream base class used for reading data from a disk file.
Definition: instream_file.h:28
slice contents
The contents of the document (or likewise).
Definition: document.h:43
static std::string mkstemp(std::string prefix)
Generate a temporary filename containing the given prefix.
Definition: file.cpp:329
Subclass of instream for reading data from a disk file.
virtual void read(document &buffer)
Read buffer.contents.size() bytes of data into buffer.contents, resizing on eof.
Definition: instream_file.cpp:44
File based I/O methods including whole file and partial files.
Definition: file.h:45
allocator & contents_allocator
If memory is needed for the document contents then allocate from here.
Definition: document.h:41
Definition: compress_integer_elias_delta_simd.c:23
size_t size(void) const
Return the length of this slice.
Definition: slice.h:256