📄 confmgr.cpp
字号:
/* FILE: confmgr.cppPROJECT: hide AUTHOR: James MartinCREATED: 9/15/2002*/#include "confmgr.h"//#include "portdef.h"#include <cstring>#include <fstream>//#include <cstdlib>///////////////////// EditorConfMgrbool EditorConfMgr::save(){ std::ofstream out(m_path); if (!out) return false; out << "FONTSIZE=" << m_FontSize << "\n"; out.close(); return true;}bool EditorConfMgr::load(){ char line[1024], *p = NULL; std::ifstream in(m_path); if (!in) return false; in.getline(line, sizeof(line)); while (!in.eof()) { if (strstr(line, "FONTSIZE=")) { strtok(line, "="); if ((p = strtok(NULL, "\n"))) m_FontSize = p; } in.getline(line, sizeof(line)); } in.close(); return true;}///////////////////// GlobalConfMgrbool GlobalConfMgr::save(){ std::ofstream out(m_path); if (!out) return false; out << "OPENLASTPROJ=" << m_bOpenLastProj << "\n"; out << "LASTPROJ=" << m_LastProj << "\n"; out.close(); return true;}bool GlobalConfMgr::load(){ char line[1024], *p = NULL; std::ifstream in(m_path); if (!in) return false; in.getline(line, sizeof(line)); while (!in.eof()) { if (strstr(line, "OPENLASTPROJ=")) { strtok(line, "="); if ((p = strtok(NULL, "\n"))) m_bOpenLastProj = atoi(p); } else if (strstr(line, "LASTPROJ=")) { strtok(line, "="); if ((p = strtok(NULL, "\n"))) m_LastProj = p; } in.getline(line, sizeof(line)); } in.close(); return true;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -