Skip to content
This repository has been archived by the owner on Jun 8, 2021. It is now read-only.

Generate File{Input,Output,IO}Stream automatically #86

Merged
merged 2 commits into from
Feb 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions Gir.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@ generate = [
"Gio.DataStreamNewlineType",
"Gio.FileCreateFlags",
"Gio.FileInfo",
"Gio.FileInputStream",
"Gio.FileIOStream",
"Gio.FileOutputStream",
"Gio.FileQueryInfoFlags",
"Gio.FileType",
"Gio.Icon",
"Gio.InetSocketAddress",
"Gio.IOStreamSpliceFlags",
"Gio.Menu",
"Gio.MenuAttributeIter",
Expand All @@ -32,35 +36,34 @@ generate = [
"Gio.MenuModel",
"Gio.MountOperation",
"Gio.MountOperationResult",
"Gio.NetworkAddress",
"Gio.NetworkService",
"Gio.NotificationPriority",
"Gio.OutputStreamSpliceFlags",
"Gio.PasswordSave",
"Gio.Permission",
"Gio.Resolver",
"Gio.ResolverRecordType",
"Gio.ResourceError",
"Gio.ResourceLookupFlags",
"Gio.SettingsBindFlags",
"Gio.SettingsSchema",
"Gio.SimpleActionGroup",
"Gio.SimplePermission",
"Gio.SocketFamily",
"Gio.SocketType",
"Gio.SocketProtocol",
"Gio.SocketAddress",
"Gio.InetSocketAddress",
"Gio.SocketAddressEnumerator",
"Gio.SocketClient",
"Gio.SocketClientEvent",
"Gio.SocketConnectable",
"Gio.SocketConnection",
"Gio.SocketService",
"Gio.SocketFamily",
"Gio.SocketListenerEvent",
"Gio.SocketClient",
"Gio.SocketClientEvent",
"Gio.ThreadedSocketService",
"Gio.TcpConnection",
"Gio.Resolver",
"Gio.ResolverRecordType",
"Gio.SocketProtocol",
"Gio.SocketService",
"Gio.SocketType",
"Gio.SrvTarget",
"Gio.NetworkAddress",
"Gio.NetworkService",
"Gio.TcpConnection",
"Gio.ThreadedSocketService",
"Gio.ThemedIcon",
"Gio.TlsCertificate",
"Gio.TlsCertificateFlags",
Expand All @@ -70,9 +73,6 @@ ignore = [
]

manual = [
"Gio.FileInputStream",
"Gio.FileIOStream",
"Gio.FileOutputStream",
"GLib.Bytes",
"GLib.Error",
"GLib.Variant",
Expand Down
2 changes: 1 addition & 1 deletion gir-files
4 changes: 2 additions & 2 deletions src/auto/action.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file was generated by gir (https://github.com/gtk-rs/gir @ 72ba992)
// from gir-files (https://github.com/gtk-rs/gir-files @ 77d1f70)
// This file was generated by gir (https://github.com/gtk-rs/gir @ bd67955)
// from gir-files (https://github.com/gtk-rs/gir-files @ db49619)
// DO NOT EDIT

#[cfg(any(feature = "v2_38", feature = "dox"))]
Expand Down
4 changes: 2 additions & 2 deletions src/auto/action_group.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file was generated by gir (https://github.com/gtk-rs/gir @ 72ba992)
// from gir-files (https://github.com/gtk-rs/gir-files @ 77d1f70)
// This file was generated by gir (https://github.com/gtk-rs/gir @ bd67955)
// from gir-files (https://github.com/gtk-rs/gir-files @ db49619)
// DO NOT EDIT

use ffi;
Expand Down
4 changes: 2 additions & 2 deletions src/auto/action_map.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file was generated by gir (https://github.com/gtk-rs/gir @ 72ba992)
// from gir-files (https://github.com/gtk-rs/gir-files @ 77d1f70)
// This file was generated by gir (https://github.com/gtk-rs/gir @ bd67955)
// from gir-files (https://github.com/gtk-rs/gir-files @ db49619)
// DO NOT EDIT

use Action;
Expand Down
4 changes: 2 additions & 2 deletions src/auto/app_info.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file was generated by gir (https://github.com/gtk-rs/gir @ 72ba992)
// from gir-files (https://github.com/gtk-rs/gir-files @ 77d1f70)
// This file was generated by gir (https://github.com/gtk-rs/gir @ bd67955)
// from gir-files (https://github.com/gtk-rs/gir-files @ db49619)
// DO NOT EDIT

use AppInfoCreateFlags;
Expand Down
4 changes: 2 additions & 2 deletions src/auto/app_launch_context.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file was generated by gir (https://github.com/gtk-rs/gir @ 72ba992)
// from gir-files (https://github.com/gtk-rs/gir-files @ 77d1f70)
// This file was generated by gir (https://github.com/gtk-rs/gir @ bd67955)
// from gir-files (https://github.com/gtk-rs/gir-files @ db49619)
// DO NOT EDIT

use AppInfo;
Expand Down
4 changes: 2 additions & 2 deletions src/auto/application.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file was generated by gir (https://github.com/gtk-rs/gir @ 72ba992)
// from gir-files (https://github.com/gtk-rs/gir-files @ 77d1f70)
// This file was generated by gir (https://github.com/gtk-rs/gir @ bd67955)
// from gir-files (https://github.com/gtk-rs/gir-files @ db49619)
// DO NOT EDIT

use ActionGroup;
Expand Down
4 changes: 2 additions & 2 deletions src/auto/buffered_input_stream.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file was generated by gir (https://github.com/gtk-rs/gir @ 72ba992)
// from gir-files (https://github.com/gtk-rs/gir-files @ 77d1f70)
// This file was generated by gir (https://github.com/gtk-rs/gir @ bd67955)
// from gir-files (https://github.com/gtk-rs/gir-files @ db49619)
// DO NOT EDIT

use Cancellable;
Expand Down
4 changes: 2 additions & 2 deletions src/auto/buffered_output_stream.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file was generated by gir (https://github.com/gtk-rs/gir @ 72ba992)
// from gir-files (https://github.com/gtk-rs/gir-files @ 77d1f70)
// This file was generated by gir (https://github.com/gtk-rs/gir @ bd67955)
// from gir-files (https://github.com/gtk-rs/gir-files @ db49619)
// DO NOT EDIT

use FilterOutputStream;
Expand Down
4 changes: 2 additions & 2 deletions src/auto/cancellable.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file was generated by gir (https://github.com/gtk-rs/gir @ 72ba992)
// from gir-files (https://github.com/gtk-rs/gir-files @ 77d1f70)
// This file was generated by gir (https://github.com/gtk-rs/gir @ bd67955)
// from gir-files (https://github.com/gtk-rs/gir-files @ db49619)
// DO NOT EDIT

use Error;
Expand Down
4 changes: 2 additions & 2 deletions src/auto/data_input_stream.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file was generated by gir (https://github.com/gtk-rs/gir @ 72ba992)
// from gir-files (https://github.com/gtk-rs/gir-files @ 77d1f70)
// This file was generated by gir (https://github.com/gtk-rs/gir @ bd67955)
// from gir-files (https://github.com/gtk-rs/gir-files @ db49619)
// DO NOT EDIT

use BufferedInputStream;
Expand Down
4 changes: 2 additions & 2 deletions src/auto/data_output_stream.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file was generated by gir (https://github.com/gtk-rs/gir @ 72ba992)
// from gir-files (https://github.com/gtk-rs/gir-files @ 77d1f70)
// This file was generated by gir (https://github.com/gtk-rs/gir @ bd67955)
// from gir-files (https://github.com/gtk-rs/gir-files @ db49619)
// DO NOT EDIT

use Cancellable;
Expand Down
4 changes: 2 additions & 2 deletions src/auto/enums.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file was generated by gir (https://github.com/gtk-rs/gir @ 72ba992)
// from gir-files (https://github.com/gtk-rs/gir-files @ 77d1f70)
// This file was generated by gir (https://github.com/gtk-rs/gir @ bd67955)
// from gir-files (https://github.com/gtk-rs/gir-files @ db49619)
// DO NOT EDIT

use ffi;
Expand Down
4 changes: 2 additions & 2 deletions src/auto/file.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file was generated by gir (https://github.com/gtk-rs/gir @ 72ba992)
// from gir-files (https://github.com/gtk-rs/gir-files @ 77d1f70)
// This file was generated by gir (https://github.com/gtk-rs/gir @ bd67955)
// from gir-files (https://github.com/gtk-rs/gir-files @ db49619)
// DO NOT EDIT

use AppInfo;
Expand Down
12 changes: 6 additions & 6 deletions src/file_i_o_stream.rs → src/auto/file_i_o_stream.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// Copyright 2013-2017, The Gtk-rs Project Developers.
// See the COPYRIGHT file at the top-level directory of this distribution.
// Licensed under the MIT license, see the LICENSE file or <http://opensource.org/licenses/MIT>
// This file was generated by gir (https://github.com/gtk-rs/gir @ bd67955)
// from gir-files (https://github.com/gtk-rs/gir-files @ db49619)
// DO NOT EDIT
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool changes 😉

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, boring :(

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be sweet if this info could be output in a separate file instead, with the option to version control it (or not) left to the repo maintainer


use Cancellable;
use Error;
use FileInfo;
use IOStream;
use ffi;
use glib;
use glib::object::IsA;
use glib::translate::*;
use glib::Priority;
use glib_ffi;
use gobject_ffi;
use std::mem;
Expand All @@ -28,7 +28,7 @@ pub trait FileIOStreamExt {

fn query_info<'a, P: Into<Option<&'a Cancellable>>>(&self, attributes: &str, cancellable: P) -> Result<FileInfo, Error>;

fn query_info_async<'a, P: Into<Option<&'a Cancellable>>, Q: FnOnce(Result<FileInfo, Error>) + Send + 'static>(&self, attributes: &str, io_priority: Priority, cancellable: P, callback: Q);
fn query_info_async<'a, P: Into<Option<&'a Cancellable>>, Q: FnOnce(Result<FileInfo, Error>) + Send + 'static>(&self, attributes: &str, io_priority: glib::Priority, cancellable: P, callback: Q);
}

impl<O: IsA<FileIOStream>> FileIOStreamExt for O {
Expand All @@ -48,7 +48,7 @@ impl<O: IsA<FileIOStream>> FileIOStreamExt for O {
}
}

fn query_info_async<'a, P: Into<Option<&'a Cancellable>>, Q: FnOnce(Result<FileInfo, Error>) + Send + 'static>(&self, attributes: &str, io_priority: Priority, cancellable: P, callback: Q) {
fn query_info_async<'a, P: Into<Option<&'a Cancellable>>, Q: FnOnce(Result<FileInfo, Error>) + Send + 'static>(&self, attributes: &str, io_priority: glib::Priority, cancellable: P, callback: Q) {
let cancellable = cancellable.into();
let cancellable = cancellable.to_glib_none();
let user_data: Box<Box<Q>> = Box::new(Box::new(callback));
Expand Down
4 changes: 2 additions & 2 deletions src/auto/file_info.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file was generated by gir (https://github.com/gtk-rs/gir @ 72ba992)
// from gir-files (https://github.com/gtk-rs/gir-files @ 77d1f70)
// This file was generated by gir (https://github.com/gtk-rs/gir @ bd67955)
// from gir-files (https://github.com/gtk-rs/gir-files @ db49619)
// DO NOT EDIT

use FileType;
Expand Down
12 changes: 6 additions & 6 deletions src/file_input_stream.rs → src/auto/file_input_stream.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// Copyright 2013-2017, The Gtk-rs Project Developers.
// See the COPYRIGHT file at the top-level directory of this distribution.
// Licensed under the MIT license, see the LICENSE file or <http://opensource.org/licenses/MIT>
// This file was generated by gir (https://github.com/gtk-rs/gir @ bd67955)
// from gir-files (https://github.com/gtk-rs/gir-files @ db49619)
// DO NOT EDIT

use Cancellable;
use Error;
use FileInfo;
use InputStream;
use ffi;
use glib;
use glib::object::IsA;
use glib::translate::*;
use glib::Priority;
use glib_ffi;
use gobject_ffi;
use std::mem;
Expand All @@ -26,7 +26,7 @@ glib_wrapper! {
pub trait FileInputStreamExt {
fn query_info<'a, P: Into<Option<&'a Cancellable>>>(&self, attributes: &str, cancellable: P) -> Result<FileInfo, Error>;

fn query_info_async<'a, P: Into<Option<&'a Cancellable>>, Q: FnOnce(Result<FileInfo, Error>) + Send + 'static>(&self, attributes: &str, io_priority: Priority, cancellable: P, callback: Q);
fn query_info_async<'a, P: Into<Option<&'a Cancellable>>, Q: FnOnce(Result<FileInfo, Error>) + Send + 'static>(&self, attributes: &str, io_priority: glib::Priority, cancellable: P, callback: Q);
}

impl<O: IsA<FileInputStream>> FileInputStreamExt for O {
Expand All @@ -40,7 +40,7 @@ impl<O: IsA<FileInputStream>> FileInputStreamExt for O {
}
}

fn query_info_async<'a, P: Into<Option<&'a Cancellable>>, Q: FnOnce(Result<FileInfo, Error>) + Send + 'static>(&self, attributes: &str, io_priority: Priority, cancellable: P, callback: Q) {
fn query_info_async<'a, P: Into<Option<&'a Cancellable>>, Q: FnOnce(Result<FileInfo, Error>) + Send + 'static>(&self, attributes: &str, io_priority: glib::Priority, cancellable: P, callback: Q) {
let cancellable = cancellable.into();
let cancellable = cancellable.to_glib_none();
let user_data: Box<Box<Q>> = Box::new(Box::new(callback));
Expand Down
12 changes: 6 additions & 6 deletions src/file_output_stream.rs → src/auto/file_output_stream.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// Copyright 2013-2017, The Gtk-rs Project Developers.
// See the COPYRIGHT file at the top-level directory of this distribution.
// Licensed under the MIT license, see the LICENSE file or <http://opensource.org/licenses/MIT>
// This file was generated by gir (https://github.com/gtk-rs/gir @ bd67955)
// from gir-files (https://github.com/gtk-rs/gir-files @ db49619)
// DO NOT EDIT

use Cancellable;
use Error;
use FileInfo;
use OutputStream;
use ffi;
use glib;
use glib::object::IsA;
use glib::translate::*;
use glib::Priority;
use glib_ffi;
use gobject_ffi;
use std::mem;
Expand All @@ -28,7 +28,7 @@ pub trait FileOutputStreamExt {

fn query_info<'a, P: Into<Option<&'a Cancellable>>>(&self, attributes: &str, cancellable: P) -> Result<FileInfo, Error>;

fn query_info_async<'a, P: Into<Option<&'a Cancellable>>, Q: FnOnce(Result<FileInfo, Error>) + Send + 'static>(&self, attributes: &str, io_priority: Priority, cancellable: P, callback: Q);
fn query_info_async<'a, P: Into<Option<&'a Cancellable>>, Q: FnOnce(Result<FileInfo, Error>) + Send + 'static>(&self, attributes: &str, io_priority: glib::Priority, cancellable: P, callback: Q);
}

impl<O: IsA<FileOutputStream>> FileOutputStreamExt for O {
Expand All @@ -48,7 +48,7 @@ impl<O: IsA<FileOutputStream>> FileOutputStreamExt for O {
}
}

fn query_info_async<'a, P: Into<Option<&'a Cancellable>>, Q: FnOnce(Result<FileInfo, Error>) + Send + 'static>(&self, attributes: &str, io_priority: Priority, cancellable: P, callback: Q) {
fn query_info_async<'a, P: Into<Option<&'a Cancellable>>, Q: FnOnce(Result<FileInfo, Error>) + Send + 'static>(&self, attributes: &str, io_priority: glib::Priority, cancellable: P, callback: Q) {
let cancellable = cancellable.into();
let cancellable = cancellable.to_glib_none();
let user_data: Box<Box<Q>> = Box::new(Box::new(callback));
Expand Down
4 changes: 2 additions & 2 deletions src/auto/filter_input_stream.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file was generated by gir (https://github.com/gtk-rs/gir @ 72ba992)
// from gir-files (https://github.com/gtk-rs/gir-files @ 77d1f70)
// This file was generated by gir (https://github.com/gtk-rs/gir @ bd67955)
// from gir-files (https://github.com/gtk-rs/gir-files @ db49619)
// DO NOT EDIT

use InputStream;
Expand Down
4 changes: 2 additions & 2 deletions src/auto/filter_output_stream.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file was generated by gir (https://github.com/gtk-rs/gir @ 72ba992)
// from gir-files (https://github.com/gtk-rs/gir-files @ 77d1f70)
// This file was generated by gir (https://github.com/gtk-rs/gir @ bd67955)
// from gir-files (https://github.com/gtk-rs/gir-files @ db49619)
// DO NOT EDIT

use OutputStream;
Expand Down
4 changes: 2 additions & 2 deletions src/auto/flags.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file was generated by gir (https://github.com/gtk-rs/gir @ 72ba992)
// from gir-files (https://github.com/gtk-rs/gir-files @ 77d1f70)
// This file was generated by gir (https://github.com/gtk-rs/gir @ bd67955)
// from gir-files (https://github.com/gtk-rs/gir-files @ db49619)
// DO NOT EDIT

use ffi;
Expand Down
4 changes: 2 additions & 2 deletions src/auto/functions.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file was generated by gir (https://github.com/gtk-rs/gir @ 72ba992)
// from gir-files (https://github.com/gtk-rs/gir-files @ 77d1f70)
// This file was generated by gir (https://github.com/gtk-rs/gir @ bd67955)
// from gir-files (https://github.com/gtk-rs/gir-files @ db49619)
// DO NOT EDIT

use Cancellable;
Expand Down
4 changes: 2 additions & 2 deletions src/auto/i_o_stream.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file was generated by gir (https://github.com/gtk-rs/gir @ 72ba992)
// from gir-files (https://github.com/gtk-rs/gir-files @ 77d1f70)
// This file was generated by gir (https://github.com/gtk-rs/gir @ bd67955)
// from gir-files (https://github.com/gtk-rs/gir-files @ db49619)
// DO NOT EDIT

use Cancellable;
Expand Down
4 changes: 2 additions & 2 deletions src/auto/icon.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file was generated by gir (https://github.com/gtk-rs/gir @ 72ba992)
// from gir-files (https://github.com/gtk-rs/gir-files @ 77d1f70)
// This file was generated by gir (https://github.com/gtk-rs/gir @ bd67955)
// from gir-files (https://github.com/gtk-rs/gir-files @ db49619)
// DO NOT EDIT

use Error;
Expand Down
4 changes: 2 additions & 2 deletions src/auto/inet_address.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file was generated by gir (https://github.com/gtk-rs/gir @ 72ba992)
// from gir-files (https://github.com/gtk-rs/gir-files @ 77d1f70)
// This file was generated by gir (https://github.com/gtk-rs/gir @ bd67955)
// from gir-files (https://github.com/gtk-rs/gir-files @ db49619)
// DO NOT EDIT

use SocketFamily;
Expand Down
4 changes: 2 additions & 2 deletions src/auto/inet_socket_address.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file was generated by gir (https://github.com/gtk-rs/gir @ 72ba992)
// from gir-files (https://github.com/gtk-rs/gir-files @ 77d1f70)
// This file was generated by gir (https://github.com/gtk-rs/gir @ bd67955)
// from gir-files (https://github.com/gtk-rs/gir-files @ db49619)
// DO NOT EDIT

use InetAddress;
Expand Down
4 changes: 2 additions & 2 deletions src/auto/input_stream.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file was generated by gir (https://github.com/gtk-rs/gir @ 72ba992)
// from gir-files (https://github.com/gtk-rs/gir-files @ 77d1f70)
// This file was generated by gir (https://github.com/gtk-rs/gir @ bd67955)
// from gir-files (https://github.com/gtk-rs/gir-files @ db49619)
// DO NOT EDIT

use Cancellable;
Expand Down
4 changes: 2 additions & 2 deletions src/auto/memory_input_stream.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file was generated by gir (https://github.com/gtk-rs/gir @ 72ba992)
// from gir-files (https://github.com/gtk-rs/gir-files @ 77d1f70)
// This file was generated by gir (https://github.com/gtk-rs/gir @ bd67955)
// from gir-files (https://github.com/gtk-rs/gir-files @ db49619)
// DO NOT EDIT

use InputStream;
Expand Down
4 changes: 2 additions & 2 deletions src/auto/memory_output_stream.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file was generated by gir (https://github.com/gtk-rs/gir @ 72ba992)
// from gir-files (https://github.com/gtk-rs/gir-files @ 77d1f70)
// This file was generated by gir (https://github.com/gtk-rs/gir @ bd67955)
// from gir-files (https://github.com/gtk-rs/gir-files @ db49619)
// DO NOT EDIT

use OutputStream;
Expand Down
4 changes: 2 additions & 2 deletions src/auto/menu.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file was generated by gir (https://github.com/gtk-rs/gir @ 72ba992)
// from gir-files (https://github.com/gtk-rs/gir-files @ 77d1f70)
// This file was generated by gir (https://github.com/gtk-rs/gir @ bd67955)
// from gir-files (https://github.com/gtk-rs/gir-files @ db49619)
// DO NOT EDIT

use MenuItem;
Expand Down
Loading