mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-14 19:15:46 -04:00
Save state support
This commit is contained in:
@ -2,6 +2,7 @@
|
||||
#include "YBaseLib/ByteStream.h"
|
||||
#include "types.h"
|
||||
#include <cstring>
|
||||
#include <deque>
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
#include <vector>
|
||||
@ -111,6 +112,28 @@ public:
|
||||
DoArray(data->data(), data->size());
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
void Do(std::deque<T>* data)
|
||||
{
|
||||
u32 length = static_cast<u32>(data->size());
|
||||
Do(&length);
|
||||
if (m_mode == Mode::Read)
|
||||
{
|
||||
data->clear();
|
||||
for (u32 i = 0; i < length; i++)
|
||||
{
|
||||
T value;
|
||||
Do(&value);
|
||||
data->push_back(value);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (u32 i = 0; i < length; i++)
|
||||
Do(&data[i]);
|
||||
}
|
||||
}
|
||||
|
||||
bool DoMarker(const char* marker);
|
||||
|
||||
private:
|
||||
|
Reference in New Issue
Block a user