Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » Save and file extension
Save and file extension [message #40665] Thu, 29 August 2013 11:10 Go to next message
idkfa46 is currently offline  idkfa46
Messages: 155
Registered: December 2011
Experienced Member
Hi all,
someone can give me an example for saving with xmlize and define the file extension and maybe the icon too ?


FileSel fs;
String filename;

void xxx::Save()
{
    if(IsEmpty(filename)) { SaveAs(); return; }

    if(!StoreAsXMLFile(*this, "STD", filename + ".ext"))
		Exclamation("Unable to open " + filename);
}

void xxx::SaveAs()
{
    if(!fs.ExecuteSaveAs()) return;
    filename = fs;
    Save();
}



Regards,
Matteo
Re: Save and file extension [message #40667 is a reply to message #40665] Thu, 29 August 2013 21:58 Go to previous messageGo to next message
BioBytes is currently offline  BioBytes
Messages: 307
Registered: October 2008
Location: France
Senior Member
Hi Matteo,

Did you check this below ?



www.ultimatepp.org/reference$Xmlize$en-us.html


Cheers Smile

Biobytes

[Updated on: Fri, 30 August 2013 08:52]

Report message to a moderator

Re: Save and file extension [message #40671 is a reply to message #40667] Fri, 30 August 2013 08:50 Go to previous messageGo to next message
BioBytes is currently offline  BioBytes
Messages: 307
Registered: October 2008
Location: France
Senior Member
Hi Matteo,

Perhaps also


http://www.ultimatepp.org/examples$XmlView$en-us.html


Biobytes
Re: Save and file extension [message #40672 is a reply to message #40665] Fri, 30 August 2013 10:18 Go to previous messageGo to next message
idkfa46 is currently offline  idkfa46
Messages: 155
Registered: December 2011
Experienced Member
I'm sorry but I cant see nothing about file extension and file icon.

I'd like to:
-define my own .Ext
-save file in the following format file.Ext
-Add Icon to files with .Ext


Regards,
Matteo
Re: Save and file extension [message #40674 is a reply to message #40672] Fri, 30 August 2013 12:53 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3356
Registered: August 2008
Senior Veteran
Hello Matteo

I just do the same Smile.


Best regards
IƱaki
Re: Save and file extension [message #40676 is a reply to message #40674] Fri, 30 August 2013 20:25 Go to previous messageGo to next message
BioBytes is currently offline  BioBytes
Messages: 307
Registered: October 2008
Location: France
Senior Member
Did you think of serialization and streams ?

Regards

Biobytes
Re: Save and file extension [message #40739 is a reply to message #40665] Wed, 11 September 2013 20:18 Go to previous messageGo to next message
wimpie is currently offline  wimpie
Messages: 46
Registered: March 2013
Location: holland
Member
I don't know the answer right now,
but if I understand your question correctly, the problem is not the saving of your file (you decide the filename+ext) but how the OS treats this ext.
The question really is how to register the extension with icon to the OS
Re: Save and file extension [message #40740 is a reply to message #40739] Wed, 11 September 2013 20:39 Go to previous messageGo to next message
idkfa46 is currently offline  idkfa46
Messages: 155
Registered: December 2011
Experienced Member
Yup, that's all....
Maybe a better solution to check and add file etension in save() too....

Matteo
Re: Save and file extension [message #40777 is a reply to message #40665] Sun, 15 September 2013 17:04 Go to previous message
ManfredHerr is currently offline  ManfredHerr
Messages: 67
Registered: February 2013
Location: Germany
Member
An example of mine to store Object of XXX_Editor as XML.
Please look at "Type" and "ForceExt" functions.
void XXX_Editor::SaveAsXML()
{
	FileSel fs;
	fs.Type("XML XXX File","*.xml");
	if(fs.ExecuteSaveAs()) {
		filename = fs;
		Object.name = GetFileTitle(filename);
		filename = ForceExt(filename, ".xml");
		StoreAsXMLFile(Object,Object.name,filename);
		IsModified = false;
	}
}
Previous Topic: Painter 2.0 Path definition: mix of cubics and quadratics
Next Topic: Help needed with Convert class
Goto Forum:
  


Current Time: Fri Apr 19 19:21:53 CEST 2024

Total time taken to generate the page: 0.03410 seconds