📄 qini.cpp
字号:
//---------------------------------------------------------------------------
#pragma hdrstop
#include "QINI.h"
#include "QStdlib.h"
#include "Windows.h"
#pragma package(smart_init)
//---------------------------------------------------------------------------
std::string GetConfig(const std::string& Key)
{
return GetConfig(GetAppPath() + "Config.ini", "CONFIG", Key);
}
//---------------------------------------------------------------------------
std::string GetConfig(const std::string& Tab, const std::string& Key)
{
return GetConfig(GetAppPath() + "Config.ini", Tab, Key);
}
//---------------------------------------------------------------------------
std::string GetConfig(const std::string& File, const std::string& Tab, const std::string& Key)
{
char buf[65536];
int len = ::GetPrivateProfileString(Tab.c_str(), Key.c_str(), "", buf
,sizeof(buf), File.c_str());
return std::string(buf, len);
}
//---------------------------------------------------------------------------
int GetConfigInt(const std::string& Key)
{
return QStrToInt(GetConfig(Key));
}
//---------------------------------------------------------------------------
bool SetConfig(const std::string& Key, const std::string& Value)
{
return SetConfig(GetAppPath() + "Config.ini", "CONFIG", Key, Value);
}
//---------------------------------------------------------------------------
bool SetConfig(const std::string& Tab, const std::string& Key, const std::string& Value)
{
return SetConfig(GetAppPath() + "Config.ini", Tab, Key, Value);
}
//---------------------------------------------------------------------------
bool SetConfig(const std::string& File, const std::string& Tab, const std::string& Key, const std::string& Value)
{
return ::WritePrivateProfileString(Tab.c_str(), Key.c_str(), Value.c_str(), File.c_str());
}
//---------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -