예제 #1
0
TEST(TStr, SaveLoadTxt) {
	const TStr FNm = "test.txt";

	const TStr Empty;
	const TStr Alphabet = "abcdefghijklmnoprstuvz";

	Empty.SaveTxt(FNm);
	EXPECT_EQ(Empty, TStr::LoadTxt(FNm));

	Alphabet.SaveTxt(FNm);
	EXPECT_EQ(Alphabet, TStr::LoadTxt(FNm));

	Empty.SaveTxt(FNm);
	EXPECT_EQ(Empty, TStr::LoadTxt(FNm));
}
예제 #2
0
// save the logs of the backups to the log file
void TBackupProfile::SaveLogs() const
{
    TJsonValV ArrV;
    for (int N = 0; N < LogV.Len(); N++)
        ArrV.Add(LogV[N].GetJson());
    PJsonVal JsonArr = TJsonVal::NewArr(ArrV);
    TStr JsonStr = JsonArr->SaveStr();
    JsonStr.SaveTxt(ProfileLogFile);
}