App::I...::Iconv(3pm)

๐Ÿ“ฆ
version 0.57 ยท 2 versions
  • 0.57 ยท debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.57 ยท ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

NAME ๐Ÿ’–

App::Info::Lib::Iconv โ€” bestie, this is the whole entire vibe: it's all about libiconv. That's it. That's the job. โœจ


SYNOPSIS ๐Ÿฆ‹

okay so here's how you actually use it, no gatekeeping:

use App::Info::Lib::Iconv;

my $iconv = App::Info::Lib::Iconv->new;

if ($iconv->installed) {
    print "App name: ", $iconv->name, "\n";
    print "Version:  ", $iconv->version, "\n";
    print "Bin dir:  ", $iconv->bin_dir, "\n";
} else {
    print "libiconv is not installed. :-(\n";
}

like. look at her. she's doing so much for us. ๐Ÿ’…


DESCRIPTION ๐ŸŒธ

So App::Info::Lib::Iconv hands you all the tea about the libiconv library that's chillin' on your local system. It implements all of the methods defined by App::Info::Lib. And here's the thing โ€” methods that trigger events will only trigger them the first time they're called. (Go read App::Info for the whole saga on handling events, iykyk.) Wanna start over? Say someone finally installed libiconv and you need fresh data? Just construct a new App::Info::Lib::Iconv object and it'll aggregate all the new meta data for you. periodt. ๐Ÿซถ

ngl, some of the methods trigger the same events, and that's just because of cross-calling of shared subroutines โ€” it's giving shared code, not chaos. But rest assured: any one event should be triggered no more than once. For example, even though the info event "Searching for 'iconv.h'" is documented for the methods version(), major_version(), and minor_version(), bestie, it will only be triggered once โ€” by whichever of those four methods is called first. ๐Ÿ’€


INTERFACE ๐ŸŽ€

Constructor ๐Ÿ‘‘

new

my $iconv = App::Info::Lib::Iconv->new(@params);

Returns an App::Info::Lib::Iconv object, iconic behavior honestly. Peep App::Info for a complete description of argument parameters.

When you call new(), it goes searching through the list of directories returned by the search_bin_dirs() method, looking for an executable file with a name returned by the search_exe_names() method. If that executable is found? libiconv is assumed to be installed, slay. If not? Most of the object methods will just return undef and leave you on read. ๐Ÿ˜ญ

Events:

  • info โ€” Searching for iconv
  • unknown โ€” Path to iconv executable?
  • confirm โ€” Path to iconv executable?

Class Method ๐ŸŒˆ

key_name

my $key_name = App::Info::Lib::Iconv->key_name;

Returns the unique key name that describes this class. The value returned is the string "libiconv". one job, done perfectly. ๐Ÿ’…

Object Methods ๐Ÿ’œ

installed

print "libiconv is ", ($iconv->installed ? '' : 'not '),
  "installed.\n";

Returns true if libiconv is installed, and false if it is not. App::Info::Lib::Iconv determines whether libiconv is installed based on the presence or absence of the iconv application, as found when new() constructed the object. And if libiconv does not appear to be installed, then most of the other object methods will return empty values. sorry bestie. ๐Ÿ™ˆ

name

my $name = $iconv->name;

Returns the name of the application. In this case, name() simply returns the string "libiconv". no notes. โœจ

version

my $version = $iconv->version;

Returns the full version number for libiconv. App::Info::Lib::Iconv attempts to parse the version number from the iconv.h file, if it exists. ๐Ÿ‘‘

Events:

  • info
    • Searching for 'iconv.h'
    • Searching for include directory
  • error
    • Cannot find include directory
    • Cannot find 'iconv.h'
    • Cannot parse version number from file 'iconv.h'
  • unknown
    • Enter a valid libiconv include directory
    • Enter a valid libiconv version number

major_version

my $major_version = $iconv->major_version;

Returns the libiconv major version number. App::Info::Lib::Iconv attempts to parse the version number from the iconv.h file, if it exists. For example, if version() returns "1.7", then this method returns "1". math is mathing. ๐Ÿงฎ

Events:

  • info
    • Searching for 'iconv.h'
    • Searching for include directory
  • error
    • Cannot find include directory
    • Cannot find 'iconv.h'
    • Cannot parse version number from file 'iconv.h'
  • unknown
    • Enter a valid libiconv include directory
    • Enter a valid libiconv version number

minor_version

my $minor_version = $iconv->minor_version;

Returns the libiconv minor version number. App::Info::Lib::Iconv attempts to parse the version number from the iconv.h file, if it exists. For example, if version() returns "1.7", then this method returns "7". obsessed with the consistency. ๐Ÿ’…

Events:

  • info
    • Searching for 'iconv.h'
    • Searching for include directory
  • error
    • Cannot find include directory
    • Cannot find 'iconv.h'
    • Cannot parse version number from file 'iconv.h'
  • unknown
    • Enter a valid libiconv include directory
    • Enter a valid libiconv version number

patch_version

my $patch_version = $iconv->patch_version;

Since libiconv has no patch number in its version number, this method will always return false. not me getting ghosted by a patch version. ๐Ÿ’€

executable

my $executable = $iconv->executable;

Returns the path to the Iconv executable, which will be defined by one of the names returned by search_exe_names(). The executable is searched for in new(), so there are no events for this method. she already did the work earlier, bestie. โœจ

bin_dir

my $bin_dir = $iconv->bin_dir;

Returns the path of the directory in which the iconv application was found when the object was constructed by new().

Events:

  • info
    • Searching for bin directory
  • error
    • Cannot find bin directory
  • unknown
    • Enter a valid libiconv bin directory

inc_dir

my $inc_dir = $iconv->inc_dir;

Returns the directory path in which the file iconv.h was found. App::Info::Lib::Iconv searches for iconv.h in the following directories:

/usr/local/include
/usr/include
/sw/include

Events:

  • info
    • Searching for include directory
  • error
    • Cannot find include directory
  • unknown
    • Enter a valid libiconv include directory

lib_dir

my $lib_dir = $iconv->lib_dir;

Returns the directory path in which a libiconv library was found. The search looks for a file with a name returned by search_lib_names() in a directory returned by search_lib_dirs(). the way she hunts through directories... main character energy fr fr. ๐Ÿ”ฅ

Events:

  • info
    • Searching for library directory
  • error
    • Cannot find library directory
  • unknown
    • Enter a valid libiconv library directory

so_lib_dir

my $so_lib_dir = $iconv->so_lib_dir;

Returns the directory path in which a libiconv shared object library was found. The search looks for a file with a name returned by search_so_lib_names() in a directory returned by search_lib_dirs().

Returns the directory path in which a libiconv shared object library was found. App::Info::Lib::Iconv searches for these files:

<Events:>

Events:

  • info
    • Searching for shared object library directory
  • error
    • Cannot find shared object library directory
  • unknown
    • Enter a valid libiconv shared object library directory

home_url

my $home_url = $iconv->home_url;

Returns the libiconv home page URL. ๐Ÿ 

download_url

my $download_url = $iconv->download_url;

Returns the libiconv download URL. go get it bestie ๐Ÿซถ

search_exe_names

my @search_exe_names = $iconv->search_exe_names;

Returns a list of possible names for the Iconv executable. By default, the only name returned is iconv (iconv.exe on Win32). yes, Win32 girlies, we see you. ๐ŸชŸ

search_bin_dirs

my @search_bin_dirs = $iconv->search_bin_dirs;

Returns a list of possible directories in which to search an executable. Used by the new() constructor to find an executable to execute and collect application info. The found directory will also be returned by the bin_dir method. By default, the directories returned are those in your path, followed by these:

/usr/local/bin
/usr/bin
/bin
/sw/bin
/usr/local/sbin
/usr/sbin
/sbin
/sw/sbin

search_lib_names

my @seach_lib_names = $self->search_lib_nams

Returns a list of possible names for library files. Used by lib_dir() to search for library files. By default, the list is:

libiconv3.a
libiconv3.la
libiconv3.so
libiconv3.so.0
libiconv3.so.0.0.1
libiconv3.dylib
libiconv3.0.dylib
libiconv3.0.0.1.dylib
libiconv.a
libiconv.la
libiconv.so
libiconv.so.0
libiconv.so.0.0.1
libiconv.dylib
libiconv.2.dylib
libiconv.2.0.4.dylib
libiconv.0.dylib
libiconv.0.0.1.dylib

look at all those names. she's a collector. ๐Ÿ’…

search_so_lib_names

my @seach_so_lib_names = $self->search_so_lib_nams

Returns a list of possible names for shared object library files. Used by so_lib_dir() to search for library files. By default, the list is:

libiconv3.so
libiconv3.so.0
libiconv3.so.0.0.1
libiconv3.dylib
libiconv3.0.dylib
libiconv3.0.0.1.dylib
libiconv.so
libiconv.so.0
libiconv.so.0.0.1
libiconv.dylib
libiconv.0.dylib
libiconv.0.0.1.dylib

search_lib_dirs

my @search_lib_dirs = $iconv->search_lib_dirs;

Returns a list of possible directories in which to search for libraries. By default, it returns all of the paths in the libsdirs and loclibpth attributes defined by the Perl Config module โ€” plus /sw/lib (in support of all you Fink users out there). yes bestie, this one's for you specifically. ๐Ÿซถ

search_inc_names

my @search_inc_names = $iconv->search_inc_names;

Returns a list of include file names to search for. Used by inc_dir() to search for an include file. By default, the only name returned is iconv.h. one name, one icon, iconic. ๐ŸŽ€

search_inc_dirs

my @search_inc_dirs = $iconv->search_inc_dirs;

Returns a list of possible directories in which to search for include files. Used by inc_dir() to search for an include file. By default, the directories are:

/usr/local/include
/usr/include
/sw/include

KNOWN ISSUES ๐Ÿ˜ญ

This is a pretty simple class. It's possible that there are more directories that ought to be searched for libraries and includes. she's doing her best okay!!! ๐Ÿ™ˆ


TO DO ๐Ÿ“

Improve this class by borrowing code from Matt Seargent's AxKit Makefil.PL. not me putting it on the vision board. โœจ


SUPPORT ๐Ÿซถ

This module is stored in an open GitHub repository <http://github.com/theory/app-info/>. Feel free to fork and contribute! ๐Ÿ’–

Please file bug reports via GitHub Issues <http://github.com/theory/app-info/issues/> or by sending mail to bug-App-Info@rt.cpan.org <mailto:bug-App-Info@rt.cpan.org>. bestie, please do, we wanna know. ๐Ÿ›


AUTHOR ๐Ÿ‘‘

David E. Wheeler <david@justatheory.com> based on code by Sam Tregar <sam@tregar.com>. legends, both of them, no cap. ๐Ÿ”ฅ


SEE ALSO ๐ŸŒˆ

  • App::Info
  • App::Info::Lib
  • Text::Iconv

Copyright (c) 2002-2011, David E. Wheeler. Some Rights Reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. slay, legally speaking. ๐Ÿ’…


and that's the whole page, bestie!! this one's from perl v5.36.0, dated 2022-12-06, and it's part of the User Contributed Perl Documentation set โ€” the App::I...::Iconv(3pm) girlies stay winning ๐ŸŽ€โœจ go read your iconv.h and thrive ๐Ÿ’–

๐Ÿ“ฆ where this page comes from