X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Fserialize.h;h=8b75cf8b83d7d2f1f91f8fccf1aec7a02222740e;hb=d11488abd05cb39a9f481e7c4c35f780197a3d28;hp=c046bf37ef021cd77a0cb7854406cfb4b1ddce99;hpb=db1a5609a0f391f6595781bfc6fc4c032ac8477d;p=novacoin.git diff --git a/src/serialize.h b/src/serialize.h index c046bf3..8b75cf8 100644 --- a/src/serialize.h +++ b/src/serialize.h @@ -1,7 +1,7 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying -// file license.txt or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_SERIALIZE_H #define BITCOIN_SERIALIZE_H @@ -265,11 +265,11 @@ uint64 ReadCompactSize(Stream& is) -// -// Wrapper for serializing arrays and POD -// There's a clever template way to make arrays serialize normally, but MSVC6 doesn't support it -// #define FLATDATA(obj) REF(CFlatData((char*)&(obj), (char*)&(obj) + sizeof(obj))) + +/** Wrapper for serializing arrays and POD. + * There's a clever template way to make arrays serialize normally, but MSVC6 doesn't support it. + */ class CFlatData { protected: @@ -302,9 +302,7 @@ public: -// -// string stored as a fixed length field -// +/** string stored as a fixed length field */ template class CFixedFieldString { @@ -856,11 +854,11 @@ struct zero_after_free_allocator : public std::allocator -// -// Double ended buffer combining vector and stream-like interfaces. -// >> and << read and write unformatted data using the above serialization templates. -// Fills with data in linear time; some stringstream implementations take N^2 time. -// +/** Double ended buffer combining vector and stream-like interfaces. + * + * >> and << read and write unformatted data using the above serialization templates. + * Fills with data in linear time; some stringstream implementations take N^2 time. + */ class CDataStream { protected: @@ -1220,12 +1218,12 @@ int main(int argc, char *argv[]) -// -// Automatic closing wrapper for FILE* -// - Will automatically close the file when it goes out of scope if not null. -// - If you're returning the file pointer, return file.release(). -// - If you need to close the file early, use file.fclose() instead of fclose(file). -// +/** RAII wrapper for FILE*. + * + * Will automatically close the file when it goes out of scope if not null. + * If you're returning the file pointer, return file.release(). + * If you need to close the file early, use file.fclose() instead of fclose(file). + */ class CAutoFile { protected: @@ -1236,8 +1234,6 @@ public: int nType; int nVersion; - typedef FILE element_type; - CAutoFile(FILE* filenew=NULL, int nTypeIn=SER_DISK, int nVersionIn=PROTOCOL_VERSION) { file = filenew;