diff options
| author | Maarten Vanraes <alien@mageia.org> | 2016-02-26 22:23:39 +0100 | 
|---|---|---|
| committer | Maarten Vanraes <alien@mageia.org> | 2016-05-14 09:25:24 +0200 | 
| commit | 7ebd42f91c04e619a3c7ab33f87632425722b8f4 (patch) | |
| tree | 2e78ad0b4b1537fbe96652a4ad162fe196b93fcd /lib | |
| parent | 6df472b92d3ec94c45c52eb9252c258d782cf29d (diff) | |
| download | manatools-7ebd42f91c04e619a3c7ab33f87632425722b8f4.tar manatools-7ebd42f91c04e619a3c7ab33f87632425722b8f4.tar.gz manatools-7ebd42f91c04e619a3c7ab33f87632425722b8f4.tar.bz2 manatools-7ebd42f91c04e619a3c7ab33f87632425722b8f4.tar.xz manatools-7ebd42f91c04e619a3c7ab33f87632425722b8f4.zip | |
IOs: add comparison function
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/ManaTools/Shared/disk_backend/IOs.pm | 30 | 
1 files changed, 30 insertions, 0 deletions
| diff --git a/lib/ManaTools/Shared/disk_backend/IOs.pm b/lib/ManaTools/Shared/disk_backend/IOs.pm index 5a6dfd30..eb562904 100644 --- a/lib/ManaTools/Shared/disk_backend/IOs.pm +++ b/lib/ManaTools/Shared/disk_backend/IOs.pm @@ -120,6 +120,36 @@ sub list {  #============================================================= +=head2 is_equal + +=head3 INPUT + +    $ios: ManaTools::Shared::disk_backend::IOs + +=head3 OUTPUT + +    bool + +=head3 DESCRIPTION + +    this method returns true of $self is equal to $ios + +=cut + +#============================================================= +sub is_equal { +    my $self = shift; +    my $ios = shift; + +    return 0 if $self->length() != $ios->length(); +    for my $key (keys %{$self->ios()}) { +        return 0 if $ios->ios()->{$key} != $self->ios()->{$key}; +    } +    return 1; +} + +#============================================================= +  =head2 append  =head3 INPUT | 
