⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ideoptions.cpp

📁 一个可视化的编译器
💻 CPP
字号:
#include "StdAfx.h"
#include "IDEOptions.h"
namespace LeastLIDE{
using namespace System;
using namespace System::IO;

IDEOptions::IDEOptions(void):
	interpreterPath(gcnew String("")),
	interpreterParams(gcnew String("")),
	editorFontName(gcnew String("Courier New")),
	editorFontSize(10)
{
	
}

void IDEOptions::SetInterpreter(String ^path, String ^params) {
	this->interpreterPath = path;
	this->interpreterParams = params;
}

void IDEOptions::SetEditor(String ^fontName, float fontSize) {
	this->editorFontName = fontName;
	this->editorFontSize = fontSize;
}

String ^ IDEOptions::GetInterpreterPath() {
	return (gcnew String(this->interpreterPath));
}
String ^ IDEOptions::GetInterpreterParams() {
	return (gcnew String(this->interpreterParams));
}
String ^ IDEOptions::GetEditorFontName() {
	return (gcnew String(this->editorFontName));
}
float IDEOptions::GetEditorFontSize() {
	return this->editorFontSize;
}

void IDEOptions::Load() {
	StreamReader ^fileStream = gcnew StreamReader("options.conf"); 
	String ^line = gcnew String(" ");

	line = fileStream->ReadLine();
	if (line->IndexOf("interpreterPath")) {
		line = fileStream->ReadLine();
		interpreterPath = line;
	} 
	line = fileStream->ReadLine();
	if (line->IndexOf("interpreterParams"))
	{
		line = fileStream->ReadLine();
		interpreterParams = line;
	}
	line = fileStream->ReadLine();
	if (line->IndexOf("editorFontName"))
	{
		line = fileStream->ReadLine();
		editorFontName = line;
	}
	line = fileStream->ReadLine();
	if (line->IndexOf("editorFontSize"))
	{
		line = fileStream->ReadLine();
		editorFontSize = float::Parse(line);
	}
	
	fileStream->Close();
}

void IDEOptions::Save() {
	StreamWriter ^fileStream = gcnew StreamWriter("options.conf"); 

	fileStream->WriteLine("[interpreterPath]");
	fileStream->WriteLine(interpreterPath);
	fileStream->WriteLine("[interpreterParams]");
	fileStream->WriteLine(interpreterParams);
	fileStream->WriteLine("[editorFontName]");
	fileStream->WriteLine(editorFontName);
	fileStream->WriteLine("[editorFontSize]");
	fileStream->WriteLine(editorFontSize);

	fileStream->Close();
}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -