12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- //
- // Created by Иван_Архипов on 31.10.2017.
- //
- #define NOMINMAX
- #include "DatFile.h"
- #include <EasyLogging++/easylogging++.h>
- #define ELPP_FEATURE_CRASH_LOG
- INITIALIZE_EASYLOGGINGPP
- #ifdef WIN32
- #define fseek _fseeki64
- #define ftell _ftelli64
- #endif
- extern "C++"
- {
- namespace LOTRO_DAT {
- //------------------------------------------------//
- // INIT SECTION
- //------------------------------------------------//
- DatFile::DatFile() {
- el::Configurations defaultConf;
- defaultConf.setToDefault();
- defaultConf.setGlobally(el::ConfigurationType::Format,
- "%datetime %level %fbase (line %line) : %msg (function: %func)");
- defaultConf.setGlobally(el::ConfigurationType::ToFile, "true");
- defaultConf.setGlobally(el::ConfigurationType::Filename, "dat_library.log");
- defaultConf.setGlobally(el::ConfigurationType::ToStandardOutput, "true");
- defaultConf.setGlobally(el::ConfigurationType::PerformanceTracking, "true");
- defaultConf.setGlobally(el::ConfigurationType::MaxLogFileSize, "5242880"); // 5MB
- defaultConf.setGlobally(el::ConfigurationType::LogFlushThreshold, "1"); // Flush after every one log
- defaultConf.set(el::Level::Debug, el::ConfigurationType::Enabled, "false");
- defaultConf.set(el::Level::Debug, el::ConfigurationType::Filename, "dat_library_debug.log");
- el::Loggers::reconfigureAllLoggers(defaultConf);
- LOG(INFO) << "==================================================================";
- LOG(INFO) << "Starting new DatFile class instance";
- io_ = std::make_unique<DatIO>(this);
- fileSystem_ = std::make_unique<DatFileSystem>(this);
- localeManager_ = std::make_unique<DatLocaleManager>(this);
- exporter_ = std::make_unique<DatExporter>(this);
- patcher_ = std::make_unique<DatPatcher>(this);
- backupManager_ = std::make_unique<DatBackupManager>(this);
- }
- LOTRO_DAT::DatLocaleManager &DatFile::getLocaleManager() {
- return *localeManager_;
- }
- DatExporter &DatFile::getExporter() {
- return *exporter_;
- }
- LOTRO_DAT::DatPatcher &DatFile::getPatcher() {
- return *patcher_;
- }
- DatBackupManager &DatFile::getBackupManager() {
- return *backupManager_;
- }
- DatIO &DatFile::getIO() {
- return *io_;
- }
- DatFileSystem &DatFile::getFileSystem() {
- return *fileSystem_;
- }
- }
- }
|