tmp
This commit is contained in:
parent
65cb26a627
commit
1ead32d84a
71 changed files with 199 additions and 282 deletions
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
#include "Common.hpp"
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace tp {
|
||||
|
||||
// Used to transfer data to or from some sort of archive
|
||||
|
|
@ -130,4 +132,29 @@ namespace tp {
|
|||
ualni mAddress = 0;
|
||||
ualni mFirstNotWritten = 0;
|
||||
};
|
||||
|
||||
struct StringArchiver {
|
||||
std::string* val;
|
||||
|
||||
StringArchiver(std::string& val) { this->val = &val; }
|
||||
|
||||
template <typename tArchiver>
|
||||
void archiveRead(tArchiver& ar) {
|
||||
ualni len;
|
||||
ar >> len;
|
||||
val->resize(len);
|
||||
for (ualni i = 0; i < len; i++) {
|
||||
ar >> (*val)[i];
|
||||
}
|
||||
}
|
||||
|
||||
template <typename tArchiver>
|
||||
void archiveWrite(tArchiver& ar) const {
|
||||
ualni len = val->size();
|
||||
ar << len;
|
||||
for (ualni i = 0; i < len; i++) {
|
||||
ar << (*val)[i];
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
@ -2,6 +2,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "Assert.hpp"
|
||||
#include "Utils.hpp"
|
||||
#include "Common.hpp"
|
||||
|
||||
#define MODULE_SANITY_CHECK(name) DEBUG_ASSERT(name.isInitialized() && "Modules Is Not Initialized" && #name)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue