e27cf56fa2
-- zipFS has several limitations... --- in a general way, seekg doesn't work... so getting a file's size needs to be done through JFileSystem. --- getLine on files open with zipFS doesn't work so great. Not sure if it is a normal issue because files are open in binary or not... JFileSystem therefore offers a "readIntoString" function that needs to be used instead of the usual "getline" technique. However getLine can then be used on a stream connected to the string. -- tested on Windows and PSP, I also made sure android still works, but haven't tested zip support on Android. -- I tried to maintain backwards compatibility, but this might break on some platforms, if I broke some platforms and you can't find a way to fix them, please contact me and we'll figure something out -- This removes wagic::ifstream. I didn't reimplement the securities that were involved in this, apologies for that. Might be useful to reimplement such securities in JFileSystem -- I haven't tested options/profiles in a deep way, it is possible I broke that.
40 lines
660 B
C++
40 lines
660 B
C++
#include "../include/JLogger.h"
|
|
#include "../include/DebugRoutines.h"
|
|
|
|
#include <fstream>
|
|
|
|
string JLogger::lastLog = "";
|
|
|
|
void JLogger::Log(const char * text){
|
|
#ifdef DOLOG
|
|
std::ofstream file(LOG_FILE, std::ios_base::app);
|
|
if (file){
|
|
file << text;
|
|
file << "\n";
|
|
file.close();
|
|
}
|
|
|
|
DebugTrace(text);
|
|
#endif
|
|
lastLog = text;
|
|
}
|
|
|
|
JLogger::JLogger(const char* text) : mText(text)
|
|
{
|
|
#ifdef DOLOG
|
|
std::ostringstream stream;
|
|
stream << mText << ": Start";
|
|
JLogger::Log(stream.str().c_str());
|
|
#endif
|
|
}
|
|
|
|
JLogger::~JLogger()
|
|
{
|
|
#ifdef DOLOG
|
|
std::ostringstream stream;
|
|
stream << mText << ": End";
|
|
JLogger::Log(stream.str().c_str());
|
|
#endif
|
|
}
|
|
|