| 1 | # Copyright (c) 2014, cPanel, Inc. | ||
| 2 | # All rights reserved. | ||
| 3 | # http://cpanel.net/ | ||
| 4 | # | ||
| 5 | # This is free software; you can redistribute it and/or modify it under the same | ||
| 6 | # terms as Perl itself. See the LICENSE file for further details. | ||
| 7 | |||
| 8 | package Filesys::POSIX::Mem::Directory; | ||
| 9 | |||
| 10 | 27 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | 27 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | |||
| 13 | 27 | ▶ | use Filesys::POSIX::Directory (); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 14 | |||
| 15 | 27 | our @ISA = qw(Filesys::POSIX::Directory); | |
| 16 | |||
| 17 | 194 | ▶ | sub new { |
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 18 | 194 | my ( $class, %initial ) = @_; | |
| 19 | 194 | return bless \%initial, $class; | |
| 20 | } | ||
| 21 | |||
| 22 | 1193 | ▶ | sub get { |
|
Subroutine
get: called CC=1 SCAR=0.0
Pod
documented
| |||
| 23 | 1193 | my ( $self, $name ) = @_; | |
| 24 | 1193 | return $self->{$name}; | |
| 25 | } | ||
| 26 | |||
| 27 | 290 | ▶ | sub set { |
|
Subroutine
set: called CC=1 SCAR=0.0
Pod
documented
| |||
| 28 | 290 | my ( $self, $name, $inode ) = @_; | |
| 29 | 290 | $self->{$name} = $inode; | |
| 30 | 290 | return $inode; | |
| 31 | } | ||
| 32 | |||
| 33 | 279 | ▶ | sub exists { |
|
Subroutine
exists: called CC=1 SCAR=0.0
Pod
documented
| |||
| 34 | 279 | my ( $self, $name ) = @_; | |
| 35 | 279 | return exists $self->{$name}; | |
| 36 | } | ||
| 37 | |||
| 38 | 9 | ▶ | sub detach { |
|
Subroutine
detach: called CC=1 SCAR=0.0
Pod
documented
| |||
| 39 | 9 | my ( $self, $name ) = @_; | |
| 40 | 9 | my $inode = $self->{$name}; | |
| 41 | |||
| 42 | 9 | delete $self->{$name}; | |
| 43 | |||
| 44 | 9 | return $inode; | |
| 45 | } | ||
| 46 | |||
| 47 | 3 | ▶ | sub delete { |
|
Subroutine
delete: called CC=1 SCAR=0.0
Pod
documented
| |||
| 48 | 3 | my ( $self, $name ) = @_; | |
| 49 | |||
| 50 | 3 | return $self->detach($name); | |
| 51 | } | ||
| 52 | |||
| 53 | 42 | ▶ | sub list { |
|
Subroutine
list: called CC=1 SCAR=0.0
Pod
documented
| |||
| 54 | 42 | my ($self) = @_; | |
| 55 | 42 | return keys %$self; | |
| 56 | } | ||
| 57 | |||
| 58 | 4 | ▶ | sub count { |
|
Subroutine
count: called CC=1 SCAR=0.0
Pod
documented
| |||
| 59 | 4 | my ($self) = @_; | |
| 60 | 4 | return scalar keys %$self; | |
| 61 | } | ||
| 62 | |||
| 63 | 84 | ▶ | sub open { |
|
Subroutine
open: called CC=1 SCAR=0.0
Pod
documented
| |||
| 64 | 84 | my ($self) = @_; | |
| 65 | |||
| 66 | 84 | $self->rewind; | |
| 67 | |||
| 68 | 84 | return $self; | |
| 69 | } | ||
| 70 | |||
| 71 | 84 | ▶ | sub rewind { |
|
Subroutine
rewind: called CC=1 SCAR=0.0
Pod
documented
| |||
| 72 | 84 | my ($self) = @_; | |
| 73 | |||
| 74 | 84 | keys %$self; | |
| 75 | } | ||
| 76 | |||
| 77 | 400 | ▶ | sub read { |
|
Subroutine
read: called CC=1 SCAR=0.0
Pod
documented
| |||
| 78 | 400 | my ($self) = @_; | |
| 79 | |||
| 80 | 400 | each %$self; | |
| 81 | } | ||
| 82 | |||
| 83 | 84 | ▶ | sub close { |
|
Subroutine
close: called CC=1 SCAR=0.0
Pod
documented
| |||
| 84 | 84 | return; | |
| 85 | } | ||
| 86 | |||
| 87 | 27 | 1; | |