typed BonoboStreams
- From: Dan Winship <danw helixcode com>
- To: gnome-components-list gnome org
- Subject: typed BonoboStreams
- Date: Thu, 18 May 2000 14:45:22 -0400 (EDT)
So, if these idl changes look good, I'll start on the code.
(I got rid of the typedefs in bonobo-persist, because the "type" is
the type of the data, not the stream, so having "stream" in the name
seemed wrong.)
Index: bonobo-persist.idl
===================================================================
RCS file: /cvs/gnome/bonobo/idl/bonobo-persist.idl,v
retrieving revision 1.14
diff -u -r1.14 bonobo-persist.idl
--- bonobo-persist.idl 2000/05/05 13:37:16 1.14
+++ bonobo-persist.idl 2000/05/18 18:42:16
@@ -17,26 +17,16 @@
exception WrongDataType {};
exception FileNotFound {};
- typedef string StreamType;
- typedef sequence<StreamType> StreamTypeList;
-
/**
* get_types:
*
- * Gets a list of supported mime types that this
- * persistor can cope with. The default / preferred
- * type being the first element.
+ * Returns a list of MIME types that the current data
+ * can be saved in. The first returned type is the
+ * preferred/default type that will be used unless it
+ * is persisted to a differently-typed stream.
*/
-/* StreamTypeList get_types ();*/
+ sequence<string> get_types ();
- /**
- * type:
- *
- * Determines the content type of the stream about to
- * be passed.
- */
-/* void set_type (in StreamType type);
- StreamType get_type ();*/
};
/*
@@ -159,9 +149,11 @@
* save:
* @stream: Where to save the state to.
*
- * Saves the state of the object to the @stream
+ * Saves the state of the object to the @stream. If
+ * @stream is typed, and the data cannot be exported
+ * to that type, WrongDataType will be raised.
*/
- void save (in Bonobo::Stream stream);
+ void save (in Bonobo::Stream stream) raises (WrongDataType);
/**
* get_size_max:
Index: bonobo-storage.idl
===================================================================
RCS file: /cvs/gnome/bonobo/idl/bonobo-storage.idl,v
retrieving revision 1.14
diff -u -r1.14 bonobo-storage.idl
--- bonobo-storage.idl 2000/05/02 20:48:56 1.14
+++ bonobo-storage.idl 2000/05/18 18:42:16
@@ -110,6 +110,21 @@
raises (NotSupported);
/**
+ * set_type:
+ *
+ * Sets the MIME type of the stream.
+ */
+ void set_type (in String type);
+
+ /**
+ * get_type:
+ *
+ * Returns the MIME type of the stream, or "*" if
+ * it is unknown.
+ */
+ String get_type ();
+
+ /**
* lock_region:
*
*/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]