Appendix A FAQ
- Q: Why don’t you supply general data block I/O methods, taking
void
pointers as arguments, so i can read all my data into a
struct
at once?
- A: This, in general, is a broken idea. It only makes sense if
you plan to write your program for only one architecture and want a
fast way to read your whole data into memory. This is not what
libbinio was meant for, so such methods will never be
implemented. libbinio cannot know what data types your
struct
is made of and thus cannot do any transparent data conversion. And
there’s even more: Most compilers align their struct
s to a
special multiple of bytes (mostly the current architecture’s data word
size). libbinio doesn’t (and cannot) know about all this and would
just read the data byte by byte, completely ignoring the alignment and
causing you to be unable to read any of your data.
- Q: Why haven’t you implemented error reporting using exceptions,
instead of this darn
error()
method polling?
- A: Because exceptions aren’t supported on all compiler
platforms.