Facebook
From Czapla, 7 Years ago, written in C++.
Embed
Download Paste or View Raw
Hits: 196
  1. #include <iostream>
  2. #include "consola.h"
  3. #include <string>
  4. #include <time.h>
  5.  
  6.  
  7. using namespace std;
  8.  
  9. Konsola konsola;
  10. double skala = 0.66666;
  11.  Konsola ::Konsola(void)
  12. {
  13.  
  14.         plik.open("log/konsola.log", ios::trunc | ios::in| ios::out);
  15.         plik << "log buldiera sfml by czapla" << endl;
  16.         plik << "autor: Czapla " << endl;
  17.  
  18.         time(&czas);
  19.         localtime_s(&czaas, &czas);
  20.         int a = czaas.tm_mday;
  21.         string aa="";
  22.         if (a < 10) { aa = "0"; }
  23.        
  24.         int b = czaas.tm_mon +1;
  25.         string bb;
  26.         if (b < 10) { bb = "0"; }
  27.  
  28.         int c = czaas.tm_year  + 1900;
  29.  
  30.         plik << "data uruchomienia : "<<czaas.tm_hour <<":"<<czaas.tm_min <<" , "<<aa<<a<<"."<<bb<<b <<"."<<c<<endl;
  31. }
  32.  void Konsola::log(string tekst)
  33.  {
  34.          plik << tekst << endl;
  35.  
  36.  
  37.  }
  38.  void Konsola::log(int b)
  39.  {
  40.          plik << b << endl;
  41.  }
  42.  void Konsola::log(double b)
  43.  {
  44.          plik << b << endl;
  45.  }
captcha