mpw/toolbox/toolbox.h

44 lines
801 B
C
Raw Normal View History

2013-02-07 04:44:12 +00:00
#ifndef __mpw_toolbox_h__
#define __mpw_toolbox_h__
2013-02-13 03:35:15 +00:00
#include <string>
2013-02-16 23:51:28 +00:00
#include <cstdint>
#include <cstdio>
2013-02-08 00:21:47 +00:00
namespace ToolBox
{
2013-02-16 23:51:28 +00:00
extern bool Trace;
template<typename... Args>
inline void Log(const char *format, Args... args)
{
if (Trace) fprintf(stderr, format, args...);
}
2013-03-28 03:54:47 +00:00
inline void Log(const char *format)
{
if (Trace) fputs(format, stderr);
}
2013-02-16 23:51:28 +00:00
2015-01-18 20:20:38 +00:00
bool Init();
2013-02-08 00:21:47 +00:00
void dispatch(uint16_t trap);
2013-02-13 03:35:15 +00:00
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);
2013-02-14 03:16:05 +00:00
bool WritePString(uint32_t address, const std::string &s);
2014-07-24 17:40:57 +00:00
std::string TypeToString(uint32_t type);
2013-03-07 00:17:55 +00:00
2013-08-03 04:33:24 +00:00
std::string UnixToMac(std::string path);
std::string MacToUnix(std::string path);
2013-02-08 00:21:47 +00:00
}
2013-02-07 04:44:12 +00:00
#endif