mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +02:00
Reorganized types registration code
This commit is contained in:
@@ -115,11 +115,7 @@ public:
|
||||
bool smartPointerSerialization;
|
||||
bool saving;
|
||||
|
||||
BinarySerializer(IBinaryWriter * w): CSaverBase(w)
|
||||
{
|
||||
saving=true;
|
||||
smartPointerSerialization = true;
|
||||
}
|
||||
BinarySerializer(IBinaryWriter * w);
|
||||
|
||||
template<typename Base, typename Derived>
|
||||
void registerType(const Base * b = nullptr, const Derived * d = nullptr)
|
||||
@@ -404,30 +400,4 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class DLL_LINKAGE CSaveFile : public IBinaryWriter
|
||||
{
|
||||
public:
|
||||
BinarySerializer serializer;
|
||||
|
||||
boost::filesystem::path fName;
|
||||
std::unique_ptr<std::fstream> sfile;
|
||||
|
||||
CSaveFile(const boost::filesystem::path &fname); //throws!
|
||||
~CSaveFile();
|
||||
int write(const void * data, unsigned size) override;
|
||||
|
||||
void openNextFile(const boost::filesystem::path &fname); //throws!
|
||||
void clear();
|
||||
void reportState(vstd::CLoggerBase * out) override;
|
||||
|
||||
void putMagicBytes(const std::string &text);
|
||||
|
||||
template<class T>
|
||||
CSaveFile & operator<<(const T &t)
|
||||
{
|
||||
serializer & t;
|
||||
return * this;
|
||||
}
|
||||
};
|
||||
|
||||
VCMI_LIB_NAMESPACE_END
|
||||
|
||||
Reference in New Issue
Block a user