kabufuda/test/main.cpp

31 lines
946 B
C++
Raw Normal View History

#include "kabufuda/Card.hpp"
2016-03-26 04:26:51 +00:00
#include <iostream>
int main()
{
2016-03-26 20:16:30 +00:00
kabufuda::Card mc{_S("test.USA.raw"), "GM8E", "01"};
2016-12-29 21:37:45 +00:00
mc.format(kabufuda::ECardSlot::SlotA, kabufuda::ECardSize::Card2043Mb);
2016-12-23 09:48:32 +00:00
uint64_t a = 0;
mc.getSerial(a);
2016-12-28 21:39:10 +00:00
std::unique_ptr<kabufuda::IFileHandle> f;
mc.openFile("MetroidPrime A", f);
2016-12-29 21:37:45 +00:00
for (uint32_t i = 0; i < 127; i++)
2016-06-30 09:53:13 +00:00
{
2016-12-29 21:37:45 +00:00
char name[32] = {'\0'};
sprintf(name, "Metroid Prime %i", i);
kabufuda::ECardResult res = mc.createFile(name, kabufuda::BlockSize, f);
if (res == kabufuda::ECardResult::INSSPACE || res == kabufuda::ECardResult::NOFILE)
break;
2016-06-30 09:53:13 +00:00
mc.setPublic(f, true);
mc.setCanCopy(f, true);
mc.setCanMove(f, true);
2016-12-29 21:37:45 +00:00
mc.setCommentAddress(f, 0);
mc.write(f, "Test\0", strlen("Test") + 1);
mc.seek(f, 32, kabufuda::SeekOrigin::Begin);
mc.write(f, "Test\0", strlen("Test") + 1);
2016-03-27 03:46:52 +00:00
}
2016-03-26 04:26:51 +00:00
return 0;
}