Skip to content

Instantly share code, notes, and snippets.

@CodeMouse92
Created June 21, 2017 03:11
Show Gist options
  • Save CodeMouse92/89fcc55f7433ce59e2b8fd7424c09e6b to your computer and use it in GitHub Desktop.
Save CodeMouse92/89fcc55f7433ce59e2b8fd7424c09e6b to your computer and use it in GitHub Desktop.
IOChannel Memory Dump Demo
#include "pawlib/iochannel.hpp"
using namespace pawlib;
using namespace pawlib::ioformat;
class SomeMagicThing
{
public:
SomeMagicThing(int n1, int n2, bool b1)
:foo(n1), bar(n2), baz(b1)
{}
~SomeMagicThing(){}
private:
int foo;
int bar;
bool baz;
};
int main()
{
SomeMagicThing* thingy = new SomeMagicThing(123, 456, true);
ioc << "The memory at " << fg_green << ta_bold << ptr_address << thingy << io_send;
ioc << " is: " << io_send;
ioc << fg_blue << ta_bold << num_upper << mem_allsep
<< ptr_memory << read_size(sizeof(SomeMagicThing)) << thingy << io_end;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment