VOID Fini(INT32 code, VOID *v) { StoreToFile(index-1); fprintf(trace, "#eof\n"); fprintf(outfile, "#eof\n"); fclose(trace); fclose(outfile); }
void Ide::SaveConfig() { SaveChangedFile(ConfigFile(), StoreAsString(*this)); if(GetIniKey("DebugClipboard") == "1") { SaveChangedFile(ConfigFile() + ".bak", StoreAsString(*this)); StoreToFile(*this, ConfigFile() + ".bak1"); } SaveChangedFile(ConfigFile("ide.key"), StoreKeys()); SaveChangedFile(ConfigFile("ide.colors"), editor.StoreHlStyles()); config_time = ConfigTime(); }
void LayoutDesigner::Execute() { // frame.SetRect(100, 100, 700, 500); #ifndef flagIDERW LoadFromFile(*this); #endif OpenWindow(); frame.Run(); #ifndef flagIDERW StoreToFile(*this); #endif if(!alias_map.Save(alias_map_file)) Exclamation(NFormat("Error updating alias file [* \1%s\1].", alias_map_file)); }
//log the mem write value,addr and ip static ADDRINT RecordMemWrite(VOID* addr) { PIN_SafeCopy(&mem_value, MEMWR_addr, 8); //printf("%lu r\n",mem_value); //buf_ref->value=mem_value; //buf_ref=buf_ref+1; buffer[index].value=(UINT64)mem_value; printf("%lu\n",mem_value); //just for test if(index==MAX_SIZE-1) { StoreToFile(index);//buffer is full,store the content to file tem index=0; } else index=index+1; //fprintf(trace,"%lu \n", mem_value); return 0; }
TreeTest::TreeTest() { CtrlLayout(*this, "Window title"); //Node<One<Element> > root.SetAsRoot(); root.leaf.Create(); root.leaf->name = "/"; root.SetCount(3); Node<One<Element> > & child = root[2]; ASSERT(child.GetParent() == &root); ASSERT(child.GetRoot() == &root); child.leaf.Create(); child.leaf->name = "Hallo"; String & s = child.GetParent()->leaf->name; s = "root"; String & ss = root.leaf->name; ASSERT(ss.IsEqual(s)); //Node<Element> roota.SetAsRoot(); roota.leaf.name = "/"; roota.leaf.value = "Hallo"; roota.SetCount(3); Node<Element> & childa = roota[2]; childa.leaf.name = "Servus"; childa.leaf.value = 123; ASSERT(childa.GetParent() == &roota); ASSERT(childa.GetRoot() == &roota); String & sa = childa.GetParent()->leaf.name; sa = "root"; String & ssa = roota.leaf.name; ASSERT(ssa.IsEqual(sa)); #if 1 StoreAsXMLFile(roota, "MyTree", "check.xml"); Node<Element> roota_; LoadFromXMLFile(roota_, "check.xml"); StoreAsXMLFile(roota_, "MyTree", "check1.xml"); #endif #if 1 StoreToFile(roota, "check.cfg"); Node<Element> roota__; LoadFromFile(roota__, "check.cfg"); StoreToFile(roota__, "check1.cfg"); #endif //NodeB<Element> rootb.SetAsRoot(); rootb.name = "/"; rootb.value = "Hallo"; rootb.SetCount(3); NodeB<Element> & childb = rootb[2]; childb.name = "Servus"; childb.value = 123; ASSERT(childb.GetParent() == &rootb); ASSERT(childb.GetRoot() == &rootb); String & sb = childb.GetParent()->name; sb = "root"; String & ssb = rootb.name; ASSERT(ssb.IsEqual(sb)); #if 0 StoreAsXMLFile(rootb, "CHECK"); NodeB<Element> rootb_; LoadFromXMLFile(rootb_); StoreAsXMLFile(rootb_, "CHECK1"); #endif #if 0 StoreToFile(rootb); Node<Element> rootb__; LoadFromFile(rootb__); StoreToFile(rootb__); #endif //NodeB<One<Element> > rootc.SetAsRoot(); rootc.One<Element>::Create(); rootc->name = "/"; rootc.SetCount(3); NodeB<One<Element> > & childc = rootc[2]; ASSERT(childc.GetParent() == &rootc); ASSERT(childc.GetRoot() == &rootc); childc.One<Element>::Create(); childc->name = "Hallo"; String & sc = childc.GetParent()->operator*().name; sc = "root"; String & ssc = rootc->name; ASSERT(ssc.IsEqual(sc)); //MapNode<String, Element> mroota.SetAsRoot(); mroota.leaf.name = "/"; mroota.leaf.value = "Hallo"; mroota.Add("a"); mroota.Add("b"); mroota.Add("c"); MapNode<String, Element> & childd = mroota[2]; childd.leaf.name = "Servus"; childd.leaf.value = 123; ASSERT(childd.GetParent() == &mroota); ASSERT(childd.GetRoot() == &mroota); String & sd = childd.GetParent()->leaf.name; sd = "root"; String & ssd = roota.leaf.name; ASSERT(ssd.IsEqual(sd)); int x = 123; }
void CryConfigFile::save() const { Data configData = _config.save(); auto encrypted = _encryptor->encrypt(configData, _config.Cipher()); encrypted.StoreToFile(_path); }
void Ide::SaveLastMain() { StoreToFile(THISBACK(SerializeLastMain), ConfigFile("lastmain.cfg")); }
void Ide::SaveWorkspace() { if(console.console) return; if(main.IsEmpty()) return; StoreToFile(THISBACK(SerializeWorkspace), WorkspaceFile()); }
void SelectPackageDlg::Load() { if(selectvars && !base.IsCursor()) return; if(loading) { // If we are called recursively from ProcessEvents, stop current loading and change loadi loadi++; loading = false; return; } int current_loadi = -1; while(current_loadi != loadi) { current_loadi = loadi; if(selectvars) { String assembly = (String)base.Get(0); list.Enable(base.IsCursor()); if(!base.IsCursor()) return; LoadVars(assembly); } Vector<String> upp = GetUppDirs(); packages.Clear(); description.Hide(); progress.Show(); loading = true; data.Clear(); Index<String> dir_exists; String cache_path = CachePath(GetVarsName()); LoadFromFile(data, cache_path); data.SetCount(upp.GetCount()); for(int i = 0; i < upp.GetCount(); i++) // Scan nest folders for subfolders (package candidates) ScanFolder(upp[i], data[i], GetFileName(upp[i]), dir_exists, Null); int update = msecs(); for(int i = 0; i < data.GetCount() && loading; i++) { // Now investigate individual sub folders ArrayMap<String, PkData>& nest = data[i]; for(int i = 0; i < nest.GetCount() && loading; i++) { if(msecs(update) >= 100) { // each 100 ms update the list (and open select dialog after splash screen is closed) if(!IsSplashOpen() && !IsOpen()) Open(); progress++; SyncList(); update = msecs(); } ProcessEvents(); // keep GUI running PkData& d = nest[i]; String path = nest.GetKey(i); FindFile ff(path); if(ff && ff.IsFolder()) { String upp_path = AppendFileName(path, GetFileName(d.package) + ".upp"); LSLOW(); Time tm = FileGetTime(upp_path); if(IsNull(tm)) // .upp file does not exist - not a package d.ispackage = false; else if(tm != d.tm) { // cached info is outdated Package p; if(p.Load(upp_path)) { d.description = p.description; d.main = p.config.GetCount(); d.tm = tm; d.ispackage = true; } else d.ispackage = false; } else d.ispackage = true; if(d.ispackage) { String icon_path = AppendFileName(path, "icon16x16.png"); tm = FileGetTime(icon_path); if(IsNull(tm)) // package icon does not exist d.icon = Null; else if(tm != d.itm) { // chached package icon outdated d.icon = StreamRaster::LoadFileAny(icon_path); d.itm = tm; } } } else nest.Unlink(i); // cached folder was deleted ScanFolder(path, nest, d.nest, dir_exists, d.package + '/'); } nest.Sweep(); } StoreToFile(data, cache_path); progress.Hide(); while(IsSplashOpen()) ProcessEvents(); if(!IsOpen()) Open(); description.Show(); if(loading) { loading = false; SyncList(); } } }