-
Notifications
You must be signed in to change notification settings - Fork 26
/
LastDir.cpp
59 lines (48 loc) · 1013 Bytes
/
LastDir.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#include "StdAfx.h"
#include "Common.h"
#include "LastDir.h"
/// Constructor
CLastDir::CLastDir()
{
LoadIni();
}
/// Load ini file
void CLastDir::LoadIni()
{
YCIni ini(SBL_STR_INI_EXTRACTDATA);
ini.SetSection(_T("LastDir"));
ini.SetKey(_T("LastReadFileDir"));
ini.ReadStr(m_open, sizeof(m_open), _T(""));
ini.SetKey(_T("LastSaveFolderDir"));
ini.ReadStr(m_save, sizeof(m_save), _T(""));
}
/// Save ini file
void CLastDir::SaveIni()
{
YCIni ini(SBL_STR_INI_EXTRACTDATA);
ini.SetSection(_T("LastDir"));
ini.SetKey(_T("LastReadFileDir"));
ini.WriteStr(m_open);
ini.SetKey(_T("LastSaveFolderDir"));
ini.WriteStr(m_save);
}
/// Get the last opened folder
LPTSTR CLastDir::GetOpen()
{
return m_open;
}
/// Get the last opened folder
LPCTSTR CLastDir::GetOpen() const
{
return m_open;
}
/// Get the last folder where something was saved to
LPTSTR CLastDir::GetSave()
{
return m_save;
}
/// Get the last folder where something was saved to
LPCTSTR CLastDir::GetSave() const
{
return m_save;
}