Well is this really neccessary? Do you know of any platform that these 2 different methods give different results in a scenario like this?
I'm talking about readability here. You want to compare the first three bytes, right? So use the function that makes it clear you're comparing raw bytes, not strings of characters.
They are the reason the lib is NOT filled with memoryleaks(I have tested this extensively and I have not detected a single byte escaping. Also I'm 100% sure filedata does not escape).
They are the reason you have to write more code and to be very careful. And to check it later. If you relied on RAII instead, a quick glimpse over the code would do.
But would you REALLY store filedata using an std::vector?
Sure, why not? File data is an array of bytes. std::vector is a dynamic array. I think it's perfectly good (in fact, quite natural) to store what's an array in an array.
Wouldn't that be [...] slow?
Any decent compiler would optimize it out. If the performance still concerns you, you can use boost::scoped_array instead of a vector.
They are strings, not RenderWindows (for example).
Apart from RenderWindow being noncopyable, so you couldn't pass it by value, it's just a good and widely recognized practice to pass a heavy-to-copy objects, including containers, which strings are, by a reference to a constant.
do you really have so little time to be THAT nitpicky?
Okay, this question puzzles me. Did you mean "do you really have so
much time"? Well, yes, I do
. And you don't have to be defensive, I'm only trying to be helpful :roll:
I have also made clear why I use my own custom format.
Apparently I haven't noticed it. So, could you give a link or something?
If you made a game would you want anyone to be able to open your datafiles using winzip, and maybe a bit of bruteforce?
Why not? If someone would want to make a mod or something like that, I'd actually like them to do that. On the other hand, if someone would want to steal it, you're protected by the law anyway. And if someone
really would want to steal it, she could simply take a screenshot