#include <iostream>
#include <fstream>
class PrintInfo
{
public:
PrintInfo(const char *i_Path);
~PrintInfo();
void GetInfo(const char *i_Info);
void ExcutPrint();
void EndPrint();
private:
std::ofstream m_outInfo;
std::string m_Path;
std::string m_Info;
};
#include "PrintInfo.h"
using namespace std;
PrintInfo::PrintInfo(const char *i_Path)
{
m_Path = i_Path;
m_outInfo.open(m_Path,ios::app|ios::in);
}
PrintInfo::~PrintInfo()
{
m_outInfo.close();
}
void PrintInfo::GetInfo(const char *i_Info)
{
m_Info = i_Info;
}
void PrintInfo::ExcutPrint()
{
m_outInfo << m_Info.c_str();
m_outInfo << "\n";
}
void PrintInfo::EndPrint()
{
m_outInfo.close();
}
|