App-pimpd

 view release on metacpan or  search on metacpan

lib/App/Pimpd/Validate.pm  view on Meta::CPAN

    }

=head1 DESCRIPTION

App::Pimpd::Validate provides functions for verifying certain conditions that's
crucial for other functions.

=head1 EXPORTS

=over

=item remote_host()

Returns true if the MPD server is located on a remote host.

The MPD server is assumed to be remote if the B<mpd_host> configuration file
variable is:

  not defined
or
  equals 'localhost'
or
  equals '127.0.0.1'

=item invalid_regex()

Parameters: $regex

Returns true if the provided regex is invalid.

=item empty_playlist()

Returns true if the current playlist is empty.

=item to_terminal()

Returns true if output is going to a TTY.

=item invalid_playlist_pos()

Parameters: $integer

Returns true if supplied argument is an invalid playlist position.

=item escape()

Parameters: $string
Returns:    $string

Takes the supplied string and escapes it from evil chars the shell might
otherwise munch.

=item get_valid_lists()

Parameters: @playlists
Returns:    @valid_playlists

Takes a list and traverses it, checking if every playlist exists.

If a playlist is found to be non-existant, tries to match the string against
all known playlists. If a partial match is found, prompts for validation.

=item isa_valid_playlist

=back

=head1 SEE ALSO

App::Pimpd

=head1 AUTHOR

  Magnus Woldrich
  CPAN ID: WOLDRICH
  m@japh.se
  http://japh.se

=head1 COPYRIGHT

Copyright (C) 2010, 2011 Magnus Woldrich. All right reserved.
This program is free software; you can redistribute it and/or modify it under
the same terms as Perl itself.

=cut



( run in 0.753 second using v1.01-cache-2.11-cpan-0b5f733616e )