efl/src/lib/eio/efl_io_manager.eo

113 lines
3.3 KiB
Plaintext

import eina_types;
struct Eio.Data
{
[[A structure to handle arbitrary data to be sent over Promises.]]
data: void_ptr; [[Private data pointer]]
size: uint; [[Size of private data]]
}
function EflIoPath {
params {
@in paths: accessor<string>; [[Accessor to an array of path.]]
}
};
function EflIoDirectInfo {
params {
@in entries: accessor<Eina.File.Direct.Info>; [[Accessor to an array of info.]]
}
};
class Efl.Io.Manager (Efl.Loop_User)
{
[[Class representing an asynchronous file operation.]]
methods {
ls {
[[Lists entries in a given path.
See \@ref eina_file_ls().
]]
params {
@in path: string; [[Path we want to list entries for]]
paths: EflIoPath; [[Callback called for each packet of files found]]
}
return: ptr(Eina.Future) @owned; [[Amount of files found during the listing of the directory]]
}
direct_ls {
[[Lists entries in a given path with more information.]]
params {
@in path: string;[[Path we want to list entries for]]
@in recursive: bool; [[If $true, list entries recursively, $false otherwise]]
}
return: future<uint64, const(array<ptr(Eina.File.Direct.Info)>)>; [[List of entries in path]]
}
stat_ls {
[[Lists entries in a given path with stat information.]]
params {
@in path: string;[[Path we want to list entries for]]
@in recursive: bool; [[If $true, list entries recursively, $false otherwise]]
}
return: future<uint64, const(array<ptr(Eina.File.Direct.Info)>)>; [[List of entries in path]]
}
// Extended attributes
xattr_ls {
[[Lists all extended attributes asynchronously.]]
params {
@in path: string; [[Path we want to list entries for]]
}
return: future<uint64, const(array<string>)>; [[Extended attributes]]
}
stat {
[[Get stat info on a given file/directory.]]
params {
@in path: string; [[Path we want to get stat information for]]
}
return: ptr(Eina.Future); [[Stat information]]
}
// FIXME: Add helper for Eina.Value to Xattr
@property xattr {
[[Retrieves or sets information of a given extended attribute.]]
set {
values {
data: ptr(Eina.Binbuf); [[Data to set as information]]
flags: Eina.Xattr.Flags; [[Extended attributes flags]]
}
return: ptr(Eina.Future) @owned; [[Future for asynchronous set operation]]
}
get {
return: ptr(Eina.Future) @owned; [[Information]]
}
keys {
path: string; [[File path]]
attribute: string; [[Attribute name]]
}
}
// helper api
open {
[[Opens a file.
The fulfilled value in the promise will be the Eina.File*.]]
params {
@in path: string; [[Path to file]]
@in shared: bool; [[$true if the file can be accessed by others, $false otherwise]]
}
return: ptr(Eina.Future) @owned; [[Eina file handle]]
}
close {
[[Closes an open Eina.File.]]
params {
@in file: ptr(Eina.File); [[Eina file handle]]
// Here we're just interested whether the promise was fullfilled or not. No value needed.
}
return: ptr(Eina.Future) @owned; [[Close return code]]
}
}
}