Re: review of the Storage interface



I don't like to freeze the current API because I think it is incomplete. But I have just reviewed my review and noted that most changes are simply extensions to the current API. We can make these changes without breaking anything else:

- add more exceptions
- use long long for indexing into files
- new revert method
- more open modes
(- add locking interface)

The only real change in my last review was the new get_info method. After talking with Michael I believe we need the following changes:

- we use the old list_contents method, but we have to extend the directory_list data structure to contain the type of the entry (Storage or
Stream)

- we add a get_info method to the Stream and Storage Interface
    (to get the size, content type, access time, ...)
      StorageInfo get_info () raises (IOError);

- we can then remove the length method from the Stream interface.
    I we want to be compatible we can emulate it using get_info.

Another problem is that there is no way to set stream attributes (for example the content_type). Microsoft has SetClass() and SetStateBits() for this purpose. My suggestion is to implement a set_info method. Then we have a pair of functions (get_info, set_info) which operates on the same data structure. I think gnome-vfs uses the same approach.

StorageInfo get_info ()
            raises (IOError);

void        set_info (in StorageInfo info)
            raises (IOError);

struct StorageInfo {
  long         valid_fields;
  string       name;
  StorageType  type;
  ContentType  content_type;
  StreamSize   size;
};

eos(): If we really want such a function someone must specify the exact semantics (more than one thread can write to a stream). Adding a EOS exception is much easier. I really think we don't need this function.

If I summarize the above, there are exactly 2 changes which can affect other programs:

    - remove eos();
    - extend the directory_list data structure

But these changes are absolutely necessary.

Regards,

    Dietmar

Maciej Stachowiak wrote:

Dietmar Maurer <dietmar maurer-it com> writes:

> I suggest the following changes for the Storage interface:

These changes are all interesting, but Bonobo is supposed to enter API
freeze really soon, along with all the other currently unstable
libraries targeted for GNOME 1.4 (we agreed on "early September", and
that is already doubtful due to recent large API changes). In light of
that, I'd suggest holding off on these changes until after Bonobo 1.0.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]