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

75 lines
1.6 KiB
PHP
Raw Normal View History

2019-03-10 15:23:11 +00:00
<?php
namespace Arma\Internal;
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).
*
* @param resource|string $dest
* @param int $file_type[optional]
* @return bool
*/
function save($dest, $file_type = \Arma\FileType::ARMA_BINARY);
/**
* 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.
*
* @param resource|string $from
* @param int $file_type[optional]
* @return bool
*/
function load($from, $file_type = \Arma\FileType::AUTO_DETECT);
2019-03-10 15:23:11 +00:00
}