Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Libraries

    Nokia::File::NFB::Element 0.01

    Download button

    No screenshots available
    Downloads: 544  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Robert Price | More programs
    Perl Artistic License / FREE
    September 22nd, 2007, 09:05 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    Nokia::File::NFB::Element description

    Nokia::File::NFB::Element is a storage for a NFB file element.

    Nokia::File::NFB::Element is a storage for a NFB file element.

    SYNOPSIS

    use Nokia::File::NFB::Element;

    ## create an object.
    my $element = Nokia::File::NFB::Element({
    'name' => $filename,
    'type' => $filetype,
    'time' => $timestamp,
    'data' => $rawdata,
    });

    ## pretty print it.
    print $element->pretty_print(), "n";

    ## check if the filename is /CALENDAR
    if ($element->name() eq '/CALENDAR') {

    ## chang the filename.
    $element->name('/CALENDAR2');
    }

    ## put the binary representation of the data into a filehandle.
    print FH $element->binary();

    This module is used to store file elements from a Nokia NFB file.

    It is mainly used internally from Nokia::File::NFB, but can be used to create or modify data to be included in an NFB file.

    METHODS

    new()

    Creates a new Nokia::File::NFB::Element object.

    my nfb = Nokia::File::NFB::Element->new({
    'type' => $filetype,
    'name' => $filename,
    'timestamp' => $timestamp,
    'data' => $data,
    });

    All the elements are optional at creation stage and can be added at later.

    type - This is the type of file. It can be either '1' to represent a FILE, or '2' to represent a directory.
    name - The name of the file or directory this element represents.
    timestamp - The timestamp of the file. If none is given it takes the current time from the system clock.
    data - The raw data contained in the element.
    type()

    Get or set the filetype of the element.

    ## make the element a FILE.
    $nfb->type(1);

    ## show the element's file type.
    print "The file type is: " . $nfb->type();

    The value passed in can only be '1' to represent a file, or '2' to represent a directory.

    name()

    Get or set the filename of the element.

    ## set the filename to be Calendar.
    $nfb->type('\Calendar');

    ## show the element's file name.
    print "The file name is: " . $nfb->name();

    timestamp()

    Get or set the timestamp of the element.

    ## set the timestamp to be the current time.
    $nfb->timestamp(time());

    ## show the element's timestamp.
    print "The timestamp is: " . $nfb->timestamp();

    data()

    Get or set the data of the element.

    ## set the data.
    $nfb->data($testdata);

    ## get the element's data.
    my $testdata = $nfb->data();

    size()

    Get the size of the data part of the element.

    ## get the size of the data.
    my $datasize = $nfb->size();

    binary()

    Return the element in binary format. This is suitable for the Nokia::File::NFB::Element to use directly.

    ## return the element in binary format.
    my $element = $nfb->binary();

    pretty_print()

    Return a string with the elements (except the raw data) in a format suitable for debugging.

    ## print the element.
    print $nfb->pretty_print();

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    Nokia files | NFB storage | Perl module | NFB | element | storage

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM