Hier ist Mein aktueller Header: < /p>
Code: Select all
#ifndef HELPER_H
#define HELPER_H
#include
#include
#include
namespace Helper
{
enum LOG { ONSCREEN, OFFSCREEN };
extern std::ofstream logfile;
//std::ofstream logfile("log.txt", std::ios_base::out | std::ios_base::app );
void EnableLogging();
void Log(std::string s, LOG type);
template
std::string ToString(const T& t)
{
std::ostringstream sstr;
sstr
Hier ist die Helfer -CPP -Datei: < /p>
#include "Helper.h"
#include
void Helper::EnableLogging()
{
#ifdef WIN32
// To use console on pc
std::ofstream ctt("CON");
freopen("CON", "w", stdout);
freopen("CON", "w", stderr);
#endif
#ifdef GP2X
//To log to text file on the caanoo
logfile.open("log.txt", std::ios_base::out | std::ios_base::app );
#endif
}
void Helper::Log(std::string s, LOG type)
{
if(type == OFFSCREEN)
{
#ifdef GP2X
//log