Jump to content
Sign in to follow this  
Jascha

Save and load SQLite Database to local storage

Recommended Posts

Hello,

I want to use the SQLite Database (TSQLiteDatabase) and save and load it to the local storage (TW3LocalStorage).

Now the local storage works with strings, but the SQLite with Streams. How can I convert between string and stream?

 

Thank You

Share this post


Link to post
Share on other sites

Hey, sorry for the late response. I had plenty of stuff to do but I can tell you that the final version which will be released in a few weeks will include a new TStringStream class as you're possibly used from Delphi. Right now, all you can do is to use the System.Types.Convert.TDataType.StringToBytes and .BytesToString. ;)

Share this post


Link to post
Share on other sites

Short update: The TStringStream class now allows you to directly access Strings from a Stream, even with a primitive typecast!

All you need to do is to update your SMS Alpha using SmartUpdate.exe in your Alpha directory. ;)

Share this post


Link to post
Share on other sites

quick example code on how to use it?

Do you mean the TStringStream? That's identical to Delphi's TStringStream, see the official Emb DocWiki for more info:

http://docwiki.embarcadero.com/Libraries/Tokyo/en/System.Classes.TStringStream

 

The only difference as of now is that this TStringStream is derived directly from TMemoryStream whereas Delphi's also implements the TByteStream class.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×