mirror of
https://github.com/ksherlock/mpw.git
synced 2024-11-27 02:49:31 +00:00
45 lines
802 B
C++
45 lines
802 B
C++
#ifndef __mpw_toolbox_h__
|
|
#define __mpw_toolbox_h__
|
|
|
|
#include <string>
|
|
|
|
#include <cstdint>
|
|
#include <cstdio>
|
|
|
|
namespace ToolBox
|
|
{
|
|
extern bool Trace;
|
|
|
|
template<typename... Args>
|
|
inline void Log(const char *format, Args... args)
|
|
{
|
|
if (Trace) fprintf(stderr, format, args...);
|
|
}
|
|
|
|
inline void Log(const char *format)
|
|
{
|
|
if (Trace) fputs(format, stderr);
|
|
}
|
|
|
|
|
|
bool Init();
|
|
void dispatch(uint16_t trap);
|
|
|
|
|
|
std::string ReadCString(uint32_t address, bool fname = false);
|
|
std::string ReadPString(uint32_t address, bool fname = false);
|
|
|
|
std::string ReadString(uint32_t address, uint32_t length);
|
|
|
|
bool WritePString(uint32_t address, const std::string &s);
|
|
|
|
std::string TypeToString(uint32_t type);
|
|
|
|
|
|
std::string UnixToMac(std::string path);
|
|
std::string MacToUnix(std::string path);
|
|
}
|
|
|
|
|
|
#endif
|