×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Jun 2008
    Posts
    39

    Question Symbian File System

    I am currentlly in the process of learning Symbian
    and am reading about Streams and Stores.

    Can anyone please explain these two concepts to me
    and how they differ from the usual file I/O in c++.
    It seems that every new definition I read confuses
    me even more.

    Thanks in advance,
    Burim

  2. #2
    Nokia Developer Champion
    Join Date
    Jul 2004
    Posts
    2,015

    Re: Symbian File System

    Its the same concept

    In C++ you can stream something to the console: (this isn't the right syntax its illustrative of the idea)

    int x = 5;
    x >> stdout

    If you don't want it to be displayed to the console you could stream it to a file instead.

    x >> file.


    The process of putting displaying it to the console or putting it into the file is called streaming. In Symbian the file above would be a store and you can stream anything into the store to save it there.

    The basic built in types like TInt can be stream directly, if you think of >> as being a function (which actually it is) then image there is a function like

    TInt:perator >>() (This isn't exactly the case but imagine it is).

    All the basic built in types have the >>() function so you can stream them directly. If you have your own type you won't be able to stream it unless you first write your own >>() function. (I'm simplying a bit for the purposes of explanation).


    So a store is just a file and you stream data into it.

    But within the store you can organize your data into different streams if you want.
    For example suppose you have 3 strings "aaaa", "bbbb", "cccc" you could stream them into a store like this:


    "aaaa" >> store
    "bbbb" >> store
    "ccccc" >> store

    and in the store they would appear as aaaabbbbcccc (again a simplification).

    Now if you want to read the file, but you only want to read ccccc you can do so without first reading aaaa and bbbb:

    store >> stringfora
    store >> stringforb
    store >> stringforc

    This might be inconvenient, if you want to be able to get directly at cccc you can organize your store so that instread of containing one stream, it contains 3.

    "aaaa" >> stream 1 within store
    "bbbb" >> stream 2 within store
    "cccc" >> stream 3 withing store

    Now if you want to read from the store and want to access cccc directly, if you know the id of the 3rd stream you can open it directly without having to first read aaaa and bbbb:

    store.Open();
    stream = store.openstream(3);
    stream >> stringforc.

    Maybe that'll give you some basic idea of the concepts.

  3. #3
    Registered User
    Join Date
    Jun 2008
    Posts
    39

    Re: Symbian File System

    Thanks,
    your comments were helpfull.

Similar Threads

  1. Replies: 13
    Last Post: 2009-03-18, 11:20
  2. Is there anybody know file system filter in S60_3rd?
    By zhangwei_Nirvana in forum Symbian
    Replies: 5
    Last Post: 2008-04-26, 07:06
  3. setting file attrib
    By mearunsingh in forum Symbian
    Replies: 0
    Last Post: 2008-01-24, 15:12
  4. LESSA PDO - a Symbian system wrapper
    By Dexterp37 in forum Symbian
    Replies: 2
    Last Post: 2006-05-23, 15:15
  5. Replies: 0
    Last Post: 2004-05-21, 11:16

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×