The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

GX::HTTP::Uploads - Container class for GX::HTTP::Upload objects

SYNOPSIS

    # Load the class
    use GX::HTTP::Uploads;
    
    # Create a new container object
    $uploads = GX::HTTP::Uploads->new;
    
    # Add an upload object
    $uploads->add(
        GX::HTTP::Upload->new(
            name => 'picture',
            file => '/tmp/0001.png'
        )
    );
    
    # Retrieve an upload object by its name attribute
    $upload = $uploads->get( 'picture' );

DESCRIPTION

This module provides the GX::HTTP::Uploads class which extends the GX::Class::Object class.

METHODS

Constructor

new

Returns a new GX::HTTP::Uploads object.

    $uploads = GX::HTTP::Uploads->new;
Returns:

Public Methods

add

Adds the given upload object(s) to the container.

    $uploads->add( @uploads );
Arguments:
Exceptions:

all

Returns all upload objects in the same order they were added.

    @uploads = $uploads->all;
Returns:

clear

Empties the container.

    $uploads->clear;

count

Returns the number of upload objects currently in the container.

    $count = $uploads->count;
Returns:
  • $count ( integer )

get

Returns all upload objects with the specified name in the order they were added.

    @uploads = $uploads->get( $name );
Arguments:
  • $name ( string )

Returns:

In scalar context, the first of those objects is returned.

    $upload = $uploads->get( $name );
Arguments:
  • $name ( string )

Returns:

names

Returns the distinct names of the uploads.

    @names = $uploads->names;
Returns:
  • @names ( strings )

remove

Removes the upload objects with the specified name(s) from the container.

    $result = $uploads->remove( @names );
Arguments:
  • @names ( strings )

Returns:
  • $result ( integer )

    Number of removed upload objects.

set

Adds the given upload object(s) to the container, replacing any previously added upload objects with the same name(s).

    $uploads->set( @uploads );
Arguments:
Exceptions:

SEE ALSO

AUTHOR

Jörg A. Uzarek <uzarek@runlevelnull.de>

COPYRIGHT AND LICENSE

Copyright (c) 2009-2011 Jörg A. Uzarek.

This module is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License Version 3 as published by the Free Software Foundation.