Exemple #1
0
void EditorUI::SaveSettings()
{
	string path=applicationPath + ViewSettingsFile;
	CfgWriter writer(path.c_str());
	if (writer.IsFailed ()) {
		fltk::message ("Failed to open %s for writing view settings", path.c_str());
		return;
	}
	CfgList cfg;
	SerializeConfig (cfg, true);
	cfg.Write(writer,true);
}
Exemple #2
0
bool ArchiveList::Save () {
	string fn=applicationPath + ArchiveListFile;
	CfgWriter writer (fn.c_str());
	if (writer.IsFailed())
		return false;

	CfgList cfg;
	CfgList *archs=new CfgList;
	cfg.AddValue ("Archives", archs);
	int index=0;
	for (set<string>::iterator s=archives.begin();s!=archives.end();++s, index++) {
		char tmp[20];
		sprintf (tmp, "arch%d", index);
		archs->AddLiteral (tmp,s->c_str());
	}
	cfg.Write (writer,true);
	return true;
}
Exemple #3
0
bool TextureGroupHandler::Save(const char *fn)
{
	// open a cfg writer
	CfgWriter writer(fn);
	if (writer.IsFailed()) {
		fltk::message ("Unable to save texture groups to %s\n", fn);
		return false;
	}

	// create a config list and save it
	CfgList cfg;

	for (uint a=0;a<groups.size();a++) {
		CfgList *gc=MakeConfig(groups[a]);

		char n [10];
		sprintf (n, "group%d", a);
		cfg.AddValue (n, gc);
	}

	cfg.Write(writer,true);
	return true;
}