Compare commits

..

No commits in common. "9d542ac1c2266e67a215883afc3ad610d0de8b7b" and "e19ca07b3acb84547acaf8bd119b66d7ecb37f26" have entirely different histories.

View File

@ -3,8 +3,6 @@
#include <boost/filesystem.hpp>
#include "boost/filesystem/fstream.hpp"
#include <chrono>
#include <ctime>
#include <sstream>
#include <iostream>
@ -75,13 +73,6 @@ static void writeMacBinary(std::ostream& out, std::string filename,
const std::string& rsrcBytes = resstream.str();
// Calculate Mac-style timestamp (seconds since 1 January 1904 00:00:00)
std::tm mac_epoch_tm = {
0, 0, 0, // 00:00:00
1, 0, 4 // 1 January 1904
};
auto mac_epoch = std::chrono::system_clock::from_time_t(std::mktime(&mac_epoch_tm));
uint32_t mac_time = std::chrono::duration_cast<std::chrono::seconds>(std::chrono::system_clock::now() - mac_epoch).count();
std::ostringstream header;
byte(header, 0);
@ -100,8 +91,8 @@ static void writeMacBinary(std::ostream& out, std::string filename,
byte(header, 0);
longword(header, (int)data.size());
longword(header, (int)rsrcBytes.size());
longword(header, mac_time); // creation date
longword(header, mac_time); // modification date
longword(header, 0); // creation date
longword(header, 0); // modification date
while((int)header.tellp() < 124)
byte(header,0);
std::string headerData = header.str();