This repository has been archived on 2020-06-07. You can view files and clone it, but cannot push or open issues or pull requests.
php-armadillo/stubs/internal/Resizable.php

77 lines
1.6 KiB
PHP
Raw Normal View History

2019-03-10 15:23:11 +00:00
<?php
namespace Arma\Internal;
2019-04-04 08:07:37 +00:00
use Arma\FileType;
2019-03-13 15:19:05 +00:00
/**
* Interface for resizable objects (non-subview objects)
*
* @package Arma\Internal
*/
2019-03-10 15:23:11 +00:00
interface Resizable
{
2019-03-21 10:49:11 +00:00
// Set size
2019-03-10 15:23:11 +00:00
/**
* Set the size to be the same as the given object.
*
* The given object must be of the same root type as the calling object.
*
* @param static $other
* @return void
*/
function copySize($other);
/**
* Reset the size to zero. The object will have no elements.
*
* @return void
*/
function reset();
2019-03-21 10:49:11 +00:00
// Assignment
/**
* Set the real part of the object.
*
* Given object must have the same size as the recipient object.
*
* @param static $other
* @return void
*/
function setReal($other);
/**
* Set the imaginary part of the object.
*
* Given object must have the same size as the recipient object.
*
* @param static $other
* @return void
*/
function setImag($other);
// Saving
/**
* Store data in a file or stream (the stream must be opened in binary mode).
*
2019-04-04 08:07:37 +00:00
* @param resource|string|array $dest
* @param int $file_type[optional]
2019-03-21 10:49:11 +00:00
* @return bool
*/
2019-04-04 08:07:37 +00:00
function save($dest, $file_type = FileType::ARMA_BINARY);
2019-03-21 10:49:11 +00:00
/**
* Retrieve data from a file or stream (the stream must be opened in binary mode).
*
* On failure, the object is reset so that it has no elements.
*
2019-04-04 08:07:37 +00:00
* @param resource|string|array $from
* @param int $file_type[optional]
2019-03-21 10:49:11 +00:00
* @return bool
*/
2019-04-04 08:07:37 +00:00
function load($from, $file_type = FileType::AUTO_DETECT);
2019-03-10 15:23:11 +00:00
}