Public Member Functions | Static Public Member Functions
efl::file Struct Reference

Class file. More...

Public Member Functions

 file (Eo *eo)
 Eo Constructor. More...
 
 file (std::nullptr_t)
 nullptr_t Constructor. More...
 
 file (file const &other)
 Copy Constructor.
 
bool save (::efl::eina::string_view file_,::efl::eina::string_view key_,::efl::eina::string_view flags_) const
 Save the given image object's contents to an (image) file. More...
 
void eject () const
 Eject the represented object. More...
 
bool async_wait () const
 Block and wait until all asynchronous operations are completed. More...
 
void mmap_get (const Eina_File **f_, const char **key_) const
 Get the source mmaped file from where an image object must fetch the real image data (it must be an Eina_File). More...
 
bool mmap_set (const Eina_File *f_,::efl::eina::string_view key_) const
 Set the source mmaped file from where an image object must fetch the real image data (it must be an Eina_File). More...
 
void file_get (const char **file_, const char **key_) const
 Retrieve the source file from where an image object is to fetch the real image data (it may be an Eet file, besides pure image ones). More...
 
bool file_set (::efl::eina::string_view file_,::efl::eina::string_view key_) const
 Set the source file from where an image object must fetch the real image data (it may be an Eet file, besides pure image ones). More...
 
bool async_get () const
 Retrieves the asynchronous open flag, which will be true only if enabled and supported by the object. More...
 
void async_set (bool async_) const
 If true, file open will happen asynchronously allowing for better performance in some situations. More...
 
template<typename F >
::efl::eo::signal_connection callback_async_error_add (F &&callback_,::efl::eo::callback_priority priority_=::efl::eo::callback_priorities::default_)
 Error occured in asynchronous file operation.
 
template<typename T >
void callback_async_error_call (T *info)
 Error occured in asynchronous file operation.
 
template<typename F >
::efl::eo::signal_connection callback_async_opened_add (F &&callback_,::efl::eo::callback_priority priority_=::efl::eo::callback_priorities::default_)
 The file was successfully opened asynchronously.
 
template<typename T >
void callback_async_opened_call (T *info)
 The file was successfully opened asynchronously.
 
 file (::efl::eo::parent_type _p)
 Constructs a new efl::file object. More...
 
- Public Member Functions inherited from efl::eo::concrete
 concrete (Eo *eo)
 Class constructor. More...
 
 concrete ()
 Default constructor. More...
 
 ~concrete ()
 Class destructor.
 
 concrete (concrete const &other)
 
 concrete (concrete &&other)
 
concreteoperator= (concrete const &other)
 Assignment operator.
 
concreteoperator= (concrete &&other)
 
Eo_eo_ptr () const
 Return a pointer to the EO Object stored in this instance. More...
 
Eo_release ()
 Releases the reference from this concrete object and return the pointer to the EO Object stored in this instance. More...
 
void _reset (Eo *_ptr=nullptr)
 Reset the current pointer to reference a new Eo object.
 
int ref_get () const
 Get the reference count of this object. More...
 
void parent_set (concrete parent)
 Set the parent of this object. More...
 
eina::optional< concreteparent_get ()
 Get the parent of this object. More...
 
Eo_Dbg_Info dbg_info_get ()
 Get debug information of this object. More...
 
 operator bool () const
 

Static Public Member Functions

static Eo_Class const * _eo_class ()
 

Additional Inherited Members

- Protected Attributes inherited from efl::eo::concrete
Eo_eo_raw
 The opaque EO Object.
 

Detailed Description

Class file.

Constructor & Destructor Documentation

efl::file::file ( ::efl::eo::parent_type  _p)
inlineexplicit

Constructs a new efl::file object.

Constructs a new efl::file object. If you want this object to be a child of another Eo object, use an efl::eo::parent expression, like the example.

Example:

efl::file my_file(efl::eo::parent = parent_object);
See also
file(Eo* eo)
efl::file::file ( Eo eo)
inlineexplicit

Eo Constructor.

Constructs the object from an Eo* pointer stealing its ownership.

Parameters
eoThe Eo object pointer.
efl::file::file ( std::nullptr_t  )
inlineexplicit

nullptr_t Constructor.

Constructs an empty (null) object.

Member Function Documentation

bool efl::file::save ( ::efl::eina::string_view  file_,
::efl::eina::string_view  key_,
::efl::eina::string_view  flags_ 
) const

Save the given image object's contents to an (image) file.

The extension suffix on file will determine which saver module Evas is to use when saving, thus the final file's format. If the file supports multiple data stored in it (Eet ones), you can specify the key to be used as the index of the image in it.

You can specify some flags when saving the image. Currently acceptable flags are quality and compress. Eg.: "quality=100 compress=9"

Parameters
fileThe filename to be used to save the image (extension obligatory).
keyThe image key in the file (if an Eet one), or NULL, otherwise.
flagsString containing the flags to be used (NULL for none).
void efl::file::eject ( ) const

Eject the represented object.

Get rid of and clean the pointed resource.

bool efl::file::async_wait ( ) const

Block and wait until all asynchronous operations are completed.

Unless the async flag was set on this object, this method has no effect.

Returns false if an error occured.

void efl::file::mmap_get ( const Eina_File **  f_,
const char **  key_ 
) const

Get the source mmaped file from where an image object must fetch the real image data (it must be an Eina_File).

If the file supports multiple data stored in it (as Eet files do), you can get the key to be used as the index of the image in this file.

Since
1.10
Parameters
fThe mmaped file
keyThe image key in file (if its an Eet one), or NULL, otherwise.
bool efl::file::mmap_set ( const Eina_File f_,
::efl::eina::string_view  key_ 
) const

Set the source mmaped file from where an image object must fetch the real image data (it must be an Eina_File).

If the file supports multiple data stored in it (as Eet files do), you can specify the key to be used as the index of the image in this file.

Since
1.8
Parameters
fThe mmaped file
keyThe image key in file (if its an Eet one), or NULL, otherwise.
void efl::file::file_get ( const char **  file_,
const char **  key_ 
) const

Retrieve the source file from where an image object is to fetch the real image data (it may be an Eet file, besides pure image ones).

You must not modify the strings on the returned pointers.

Note
Use NULL pointers on the file components you're not interested in: they'll be ignored by the function.
Parameters
fileThe image file path.
keyThe image key in file (if its an Eet one), or NULL, otherwise.
bool efl::file::file_set ( ::efl::eina::string_view  file_,
::efl::eina::string_view  key_ 
) const

Set the source file from where an image object must fetch the real image data (it may be an Eet file, besides pure image ones).

If the file supports multiple data stored in it (as Eet files do), you can specify the key to be used as the index of the image in this file.

Example:

img = evas_object_image_add(canvas);
evas_object_image_file_set(img, "/path/to/img", NULL);
err = evas_object_image_load_error_get(img);
if (err != EVAS_LOAD_ERROR_NONE)
{
fprintf(stderr, "could not load image '%s'. error string is \"%s\"\n",
valid_path, evas_load_error_str(err));
}
else
{
evas_object_image_fill_set(img, 0, 0, w, h);
evas_object_resize(img, w, h);
}
Parameters
fileThe image file path.
keyThe image key in file (if its an Eet one), or NULL, otherwise.
bool efl::file::async_get ( ) const

Retrieves the asynchronous open flag, which will be true only if enabled and supported by the object.

Parameters
asyncFlag for asynchronous open.
void efl::file::async_set ( bool  async_) const

If true, file open will happen asynchronously allowing for better performance in some situations.

The file will be opened from a different thread. Classes implementing async open might then block and wait when querying information from the file (eg. image size).

Only a few objects implement this feature, and this flag may be ignored by EFL. In that case, get() will always return false.

Parameters
asyncFlag for asynchronous open.