#ifndef __LOG__FILE__HH
#define __LOG__FILE__HH
#include <string>
#include <fstream>
#include <mutex>

using namespace std;

class CLogFile
{
public:
	CLogFile();
	~CLogFile();

	void open(const char *_Filename, bool binary = false);
	void write(const char *_Str, streamsize _Count);
	void close();
	inline bool is_open() const { return m_file.is_open(); };

	void write_double(double val);
	void write_int(int val);

public:
	fstream m_file;

public:
    std::mutex m_lock;
};


class CLogFiles
{
public:
	CLogFiles();
	~CLogFiles();

	void set_config(bool binary = true, bool value = true, bool points = true)
	{
		m_bBinary = binary;
		m_bValue = value;
		m_bPoints = points;
	}

	void new_project(const char * path);
	void close_project();

private:
	bool m_bBinary;
	bool m_bValue;
	bool m_bPoints;


public:		  
	CLogFile m_logLaserBinary1;
	CLogFile m_logLaserValue1;
	CLogFile m_logPoints1;
		
	CLogFile m_logLaserBinary2;
	CLogFile m_logLaserValue2;
	CLogFile m_logPoints2;


public:
	static const string m_strFileNameLoglaserBinary1;
	static const string m_strFileNameLoglaserValue1;
	static const string m_strFileNameLogPoints1;

	static const string m_strFileNameLoglaserBinary2;
	static const string m_strFileNameLoglaserValue2;
	static const string m_strFileNameLogPoints2;
};

#endif
