Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Mon Sep 16, 2019 11:46 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Offering plist Classes
PostPosted: Sat Aug 28, 2010 2:40 am 
Offline
User avatar

Joined: Thu Oct 08, 2009 12:22 am
Posts: 28
Location: Vienna / Austria
Hello!

For free use: PListStore, Classes for plist-Files

Download:
http://www.brisk-marketing.at/RBControls/PListStore.zip

The zip-File contains the classes, a example (simple plist-Viewer) and a Helper-Class.

Create a new plist
Dim store As New PListStore()

Load a plist-File
Dim store As New PListStore(String)
// or
Dim store As New PListStore(FolderItem)
// or
Dim store As New PListStore(XmlDocument)
// or
store.Load(String)
// or
store.Load(FolderItem)
// or
store.Load(XmlDocument)

Save a plist-File
// Win, Linux, MacOs
store.SaveAsXml(FolderItem)
// Mac Os
store.SaveAsBinary(FolderItem)

Access the Root-Element
store.Root...

Example
Dim store As New PListStore()
Dim rootDict As New PListDict()
Dim childArray As New PListArray()

store.Root = rootDict

rootDict.Value("SampleString") = "SampleStringDaten"
// or
rootDict.Value("SampleString") = New PListString("SampleStringDaten")

rootDict.Value("SampleInteger") = 10
// or
rootDict.Value("SampleInteger") = New PListInteger(10)

rootDict.Value("SampleArray") = childArray

// Mixed Array
childArray.Append(New PListInteger(10))
// or
childArray.Append(10)

childArray.Append(New PListDate(New Date()))
// or
childArray.Append(New Date())

store.SaveAsXml(....

// Breadcrumb
Dim dateplist As PListDate
Dim date As Date
dateplist = store.RootAsDict.ValueAsArray("SampleArray").ValueAsDate(3)
date = store.RootAsDict.ValueAsArray("SampleArray").ValueAsDate(3).Value

Test Type
If store.RootAsDict.ValueIsAArray("SampleArray") = True Then

Regards from Vienna/Austria
Marco


Top
 Profile  
Reply with quote  
 Post subject: Re: Offering plist Classes
PostPosted: Sat Aug 28, 2010 8:33 am 
Offline

Joined: Sun Feb 19, 2006 4:00 pm
Posts: 1282
Location: Heidelberg, Germany
Thanks - but password protected?

I think I stick with MacCrafter's FREE CROSS-PLATFORM and very powerful (e.g. save or load a listbox/array/window etc in one line of code) plist class …

http://www.declaresub.com/wiki/index.php/Property_lists_and_how_to_make_them_using_the_plist_class


Last edited by Markus Winter on Sat Aug 28, 2010 10:44 am, edited 3 times in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Offering plist Classes
PostPosted: Sat Aug 28, 2010 10:32 am 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
or don't forget my FREE cross-platform INI like class...

viewtopic.php?f=6&t=31782


Open Source Code - Not encrypted - Free

_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not interested in any solutions that involve custom Plug-ins of any kind


Last edited by DaveS on Sat Aug 28, 2010 11:58 am, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Offering plist Classes
PostPosted: Sat Aug 28, 2010 11:19 am 
Offline
User avatar

Joined: Thu Oct 08, 2009 12:22 am
Posts: 28
Location: Vienna / Austria
... both are very good solutions - but - never look a gift horse in the mouth :wink:


Top
 Profile  
Reply with quote  
 Post subject: Re: Offering plist Classes
PostPosted: Sat Aug 28, 2010 11:30 am 
Offline

Joined: Sun Feb 19, 2006 4:00 pm
Posts: 1282
Location: Heidelberg, Germany
BriskMarketing wrote:
... both are very good solutions - but - never look a gift horse in the mouth :wink:

In this case I looked, and I didn't like what I saw. Password protected - what if there is an update and something isn't working? What if you want to add or change something?

There are free and very powerful alternatives - so I for one will stick with them for now.

I also think you should have mentioned that they are password protected. Would have saved me the download and the time.


Top
 Profile  
Reply with quote  
 Post subject: Re: Offering plist Classes
PostPosted: Tue Aug 31, 2010 12:27 pm 
Offline

Joined: Mon Apr 16, 2007 3:12 pm
Posts: 154
The purpose here is to offer coding tips... not purpose built code. Hence the negative comments. Post elsewhere and you'll most likely receive more favourable comments... but mention it's protected..


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group