GetData(3pm)
π NAME π
okay so, bestie, welcome to GetData(3pm) β the manual page for GetData, aka the Perl bindings to the GetData library for Dirfile access. that's it, that's the name, slay. π
β¨ SYNOPSIS β¨
lowkey the whole vibe in five lines:
use GetData;
my $DIRFILE = GetData::open("./dirfile/", $GetData::RDONLY);
# the following calls are equivalent
my $data = GetData::getdata($DIRFILE, "field", 5, 0, 1,
$GetData::UINT8);
my $data = $DIRFILE->getdata("field", 5, 0, 1, $GetData::UINT8);
two ways to call the same thing, both iconic, no notes. π«Ά
πΈ DESCRIPTION πΈ
so this module is the simple, lightweight bridge between Perl and the C GetData library. it's giving "no drama, just a clean mapping between public C functions and Perl methods." every single C function and constant gets replicated inside the GetData package, and the methods keep the exact same name as their C counterparts β except the C namespace prefix gd_ gets dropped (and GD_ too, for the C preprocessor constants). periodt.
the dirfile lvalue that GetData::open hands you back is a simplistic object. here's the cute part: any GetData method that takes a dirfile as a parameter can also just be called as a method of the dirfile object itself. (peep the synopsis above for the receipts. β¨) and dirfile metadata entries β which in C are structs of type gd_entry_t β are represented here as plain old simple hashes. easy.
by default, GetData exports nothing. zero symbols. if you want them all, you do:
use GetData "all";
but ngl this is discouraged, because it will clobber useful things like &CORE::open. do not do that to yourself bestie, that's not the move. π
throughout the module, complex data are generally represented as Math::Complex objects β but they may get simplified down to ordinary floating point numbers whenever the imaginary part is zero. no imaginary friends, no problem.
π CONSTANTS π
the module defines a large number of symbolic constants used by the API, and they mirror the constants defined in the C API one-to-one. if you only want the constants, the "constants" tag exports just those:
use GetData "constants";
some generally useful sets of constants get discussed below, and the rest show up in the method descriptions wherever they're used. π
π Data Types π
GetData knows the following data types:
$GetData::NULLβ the null data type, which returns no data.$GetData::UINT8β unsigned 8-bit integer.$GetData::INT8β signed (two's complement) 8-bit integer.$GetData::UINT16β unsigned 16-bit integer.$GetData::INT16β signed (two's complement) 16-bit integer.$GetData::UINT32β unsigned 32-bit integer.$GetData::INT32β signed (two's complement) 32-bit integer.$GetData::UINT64β unsigned 64-bit integer.$GetData::INT64β signed (two's complement) 64-bit integer.$GetData::FLOAT32β IEEE-754 standard 32-bit single precision floating point number.$GetData::FLOAT64β IEEE-754 standard 64-bit double precision floating point number.$GetData::COMPLEX64β FORTRAN and C99 conformant 64-bit single precision floating point complex number.$GetData::COMPLEX128β FORTRAN and C99 conformant 128-bit double precision floating point complex number.
π Encoding Types π
the following encoding types are known by GetData:
$GetData::BZIP2_ENCODED, $GetData::FLAC_ENCODED,
$GetData::GZIP_ENCODED, $GetData::LZMA_ENCODED,
$GetData::SIE_ENCODED, $GetData::SLIM_ENCODED,
$GetData::TEXT_ENCODED, $GetData::ZZIP_ENCODED,
$GetData::ZZSLIM_ENCODED, $GetData::UNENCODED.
the deets on these encoding types live in the dirfile-format(5) manual page β go look, iykyk. π¦
π§ Entry Types π§
these symbols are what you use to indicate entry types:
$GetData::NO_ENTRY, $GetData::BIT_ENTRY, $GetData::CARRAY_ENTRY,
$GetData::CONST_ENTRY, $GetData::DIVIDE_ENTRY,
$GetData::INDEX_ENTRY, $GetData::LINCOM_ENTRY,
$GetData::LINTERP_ENTRY, $GetData::MPLEX_ENTRY,
$GetData::MULTIPLY_ENTRY, $GetData::PHASE_ENTRY,
$GetData::POLYNOM_ENTRY, $GetData::RAW_ENTRY, $GetData::RECIP_ENTRY,
$GetData::SBIT_ENTRY, $GetData::STRING_ENTRY, $GetData::WINDOW_ENTRY
out of all of these, $GetData::NO_ENTRY is the one that flags invalid entry types, and $GetData::INDEX_ENTRY is used only for the implicit INDEX field. for the rest? check gd_entry(3) and dirfile-format(5). π
β WINDOW Operators β
these symbols are used to indicate WINDOW operators:
$GetData::WINDOP_EQ, $GetData::WINDOP_GE, $GetData::WINDOP_GT,
$GetData::WINDOP_LE, $GetData::WINDOP_LT, $GetData::WINDOP_NE,
$GetData::WINDOP_CLR, $GetData::WINDOP_SET.
π INPUT DATA π
so the functions that take sets of data as input β that's add_carray, madd_carray, put_carray, put_carray_slice, and putdata β accept that data in a whole bunch of different ways. the arguments that specify the data always show up at the very end of the argument list, and below they're written as {DATA...} in the method descriptions. here's exactly how input data arguments get parsed, in order:
- if the first data argument is
undef, it gets ignored and all the subsequent arguments are taken as data:
$dirfile->putdata("field_code", $first_frame, $first_sample,
undef, @data)
or:
$dirfile->putdata("field_code", $first_frame, $first_sample,
undef, $data[0], $data[1], $data[2], ...)
- otherwise, if the first data argument is a reference to an array, then the array is taken as the data β and any further arguments are just ignored:
$dirfile->putdata("field_code", $first_frame, $first_sample,
\@data)
- otherwise, if only two arguments make up the data argument list and the second one is a reference to an array, then the first is taken as a type code specifying the conversion type, and the second is taken as the data:
$dirfile->putdata("field_code", $first_frame, $first_sample,
$GetData::UINT8, \@data)
- otherwise, if only two arguments make up the data argument list and the second one is not a reference to an array, then the first is, again, taken as a type code, and the second is assumed to be a packed string holding the data in whatever format is appropriate for the type code you specified:
$packed_data = pack("C", @data)
$dirfile->putdata("field_code", $first_frame, $first_sample,
$GetData::UINT8, $packed_data)
- otherwise, finally, the elements of the data argument list are simply taken as data themselves:
$dirfile->putdata("field_code", $first_frame, $first_sample,
@data)
or:
$dirfile->putdata("field_code", $first_frame, $first_sample,
$data[0], $data[1], $data[2], ...)
GetData internally converts your Perl data into a format the C API can read. in cases 3 and 4 above, the type it converts into is stated explicitly right there in the call, no guessing. in the other cases, GetData has to guess an appropriate C type to convert into β and it does that by looking at the first data value:
- if the value is a
Math::Complexobject, the data get converted to double precision complex data (COMPLEX128) - if the value is an integer, the data get converted to a 64-bit signed integer (
INT64) - otherwise, the data get converted to a double precision float (
FLOAT64)
and of all the methods above, the first one is only necessary when your data array has exactly two elements β because otherwise it would get mistaken for method four if you didn't put that initial undef in front. also, the fourth method is typically the most efficient of the bunch, since the packed data scalar can often be fed straight into the C API with no type conversion needed at all. efficiency, we love her. π
π ENTRY HASHES π
the replacement for the C API's gd_entry_t object is a simple hash, and the key names are the same as the names of the gd_entry_t members. (details live in gd_entry(3), go read it bestie.)
in the entry hashes that GetData returns, only the keys appropriate for the entry type you specified will actually be present. but entry hashes you pass into GetData from your own code may have other keys than the entry type requires β and those just get ignored. no harm, no foul. π
the value hanging off the field_type key will be one of the symbols listed under "Entry Types" above. and for the entry types that have (potentially) more than one input field β that's DIVIDE, LINCOM, MPLEX, MULTIPLY, WINDOW β the value associated with the in_fields key will be a list of strings, no matter how many elements it actually has. other entry types that provide in_fields get a scalar instead, even though the key name stays plural. grammar is fake, the key name is forever. β¨
elements of the scalar array that are undef indicate literal parameters β the equivalent of NULL in the gd_entry_t's scalar member. and similarly, undef is used in scalar_ind wherever the C API uses -1, to indicate CONST fields instead of CARRAYs. π
π NON-MEMBER FUNCTIONS π
encoding_support ($ENCODING)β returns$GetData::RDWRif the library can both read and write the specified encoding,$GetData::RDONLYif it can only read it, or-1otherwise.$ENCODINGshould be one of the encoding symbols listed up above in the "Encoding Types" section. π¦
β¨ DIRFILE CREATION METHODS β¨
Okay bestie, this is where you actually make a dirfile or open one up. Two functions here, and they're giving main character energy. π«Ά
open ($DIRFILENAME, $FLAGS, $SEHANDLER=undef, $EXTRA=undef)β Creates or opens a Dirfile database called$DIRFILENAME. The$FLAGSshould be either$GetData::RDONLY(read-only access, cute and safe) or$GetData::RDWR(read-write access, chaotic if you're not careful), optionally bitwise or'd with any of these flags:
$GetData::ARM_ENDIAN, $GetData::BIG_ENDIAN, $GetData::CREAT,
$GetData::EXCL, $GetData::FORCE_ENCODING,
$GetData::FORCE_ENDIAN, $GetData::IGNORE_DUPS,
$GetData::IGNORE_REFS, $GetData::LITTLE_ENDIAN,
$GetData::NOT_ARM_ENDIAN, $GetData::PEDANTIC,
$GetData::PERMISSIVE, $GetData::PRETTY_PRINT, $GetData::TRUNC,
$GetData::TRUNCSUB, $GetData::VERBOSE,
and at most one of the encoding symbols listed above in the "Encoding Types" section, or else $GetData::AUTO_ENCODED β that one tells GetData to try to automatically determine the encoding. The meaning of the dirfile flags may be found in the gd_cbopen(3) manual page. π
$SEHANDLER is a Perl callback function that gets executed whenever a syntax error is encountered. It may be undef if you don't want a callback. When called, $SEHANDLER gets two arguments: first, a reference to a hash containing the parser data; second, the $EXTRA scalar passed to this method. $SEHANDLER is called in scalar context, and it should return either:
- an integer, one of these symbolic constants:
$GetData::SYNTAX_ABORT, $GetData::SYNTAX_CONTINUE,
$GetData::SYNTAX_IGNORE, $GetData::SYNTAX_RESCAN;
(see gd_cbopen(3) for their meaning), or
- a string containing the corrected line, in which case
$GetData::SYNTAX_RESCANis assumed; or, - a reference to a list consisting of an integer, one of the
"$GetData::SYNTAX_..."constants listed above, and then, optionally, a string containing the corrected line.
This function always returns a Dirfile object, even if the call failed. So the caller should use the returned dirfile's error() method to test for success. On error, the returned object will be flagged as invalid. π
invalid_dirfile ()β This function always returns a newly created, but invalid, Dirfile object. Unlike an invalid dirfile created (either accidentally or purposefully) usingopen(), the dirfile returned by this function always has a zero error code. Seegd_invalid_dirfile(3). β¨
π DIRFILE OBJECT METHODS π
The following methods all operate on a dirfile object returned by one of the above methods and can either be called as:
$GetData::method($dirfile, ...)
or else, as:
$dirfile->method(...)
without change in operation. No cap. π
π List of Methods π
$dirfile->add_carray ($FIELD_NAME, $DATA_TYPE, $FRAGMENT_INDEX, {DATA...})β Adds a new CARRAY field called$FIELD_NAMEto the metadata fragment indexed by$FRAGMENT_INDEX. The storage type of the CARRAY is given by$DATA_TYPE, which should be one of the symbols listed above under "Data Types". The value of the CARRAY is then set to the data given in the"{DATA...}"argument list, which also determines its length. See the "Input Data" section above for details on the allowed forms of"{DATA...}". Seegd_add_carray(3). π§$dirfile->add_const ($FIELD_NAME, $DATA_TYPE, [$VALUE, $FRAGMENT_INDEX])β Adds a new CONST field called$FIELD_NAMEto the metadata fragment indexed by$FRAGMENT_INDEX, or to the primary format file if omitted. The$DATA_TYPEargument indicates the storage type, which should be one of the symbols listed above under "Data Types". If given, the value of the field is set to$VALUE; otherwise the field will be initialised to zero. Seegd_add_const(3). π$dirfile->aliases ($FIELD_CODE)β In scalar context, returns the number of aliases of$FIELD_CODE. In list context, returns an array of alias names for$FIELD_CODE. Seegd_naliases(3)andgd_aliases(3). πΈ$dirfile->carrays ($RETURN_TYPE)β Returns the value of all carrays (excluding metafields) in the dirfile after converting them to the return type$RETURN_TYPE, which should be one of the symbols listed under "Data Types" above. If called in scalar context, returns a reference to an array of packed string data. If called in list context, returns an array of arrays of unpacked data. Seegd_carrays(3). π$dirfile->close ()β Closes the dirfile, writing changes to disk. Upon successful completion, the dirfile object will be invalidated, prohibiting further operation on it. A dirfile which is destroyed by garbage collection is discarded (see "discard" below). This function should be called if metadata need to be written to disk before the object goes out of scope. Seegd_close(3). π₯$dirfile->constants ($RETURN_TYPE)β Returns the value of all constants (excluding metafields) in the dirfile after converting them to the return type$RETURN_TYPE, which should be one of the symbols listed under "Data Types" above. If called in scalar context, returns a packed string containing the data. If called in list context, the data will be unpacked and returned as an array. Seegd_constants(3). β$dirfile->discard ()β Closes the dirfile, ignoring changes to metadata, but writing changed data to disk. Upon successful completion, the dirfile object will be invalidated, prohibiting further operation on it. This function is called automatically by the dirfile destructor, and need not be called explicitly. To save the metadata on close, use "close". Seegd_discard(3). ποΈ$dirfile->entry ($FIELD_CODE)β If called in scalar context, returns the entry type of$FIELD_CODE, one of the symbols listed above under "Entry Types". In array context, returns a hash describing the indicated field. Seegd_entry_type(3)andgd_entry(3). π$dirfile->match_entries ($REGEX, $FRAGMENT, $TYPE, $FLAGS)β In scalar context, returns the number of entries matching the supplied criteria. In list context, returns an array of the names of the entries. If$REGEXis notundef, it is a regular expression which is matched against entry names.
NB: The regular expression handling is done in the underlying C library, not in Perl. As a result, using Perl's regex grammar in$REGEXusually won't work as desired. If the C GetData library has Perl-Compatible Regular Expression (PCRE) support, the$GetData::REGEX_PCREflag can be used to select a regular expression grammar which is very similar to Perl's own. π
If $FRAGMENT is not $GetData::ALL_FRAGMENTS or undef, only entries defined in the specified fragment are searched. If $TYPE is one of the entry types listed above under "Entry Types", only entries of that type are considered. Alternatley, $TYPE may be one of:
$GetData::ALL_ENTRIES, $GetData::SCALAR_ENTRIES,
$GetData::VECTOR_ENTRIES.
Setting $TYPE to undef is equivalent to setting it to $GetData::ALL_ENTRIES. If not undef, which is treated as zero, $FLAGS should be zero or more of the following flags:
$GetData::ENTRIES_HIDDEN, $GetData::ENTRIES_NOALIAS,
$GetData::REGEX_PCRE, $GetData::REGEX_EXTENDED,
$GetData::REGEX_ICASE, $GetData::REGEX_CASELESS,
$GetData::REGEX_JAVASCRIPT, $GetData::REGEX_UNICODE
See gd_match_entries(3) for the meaning of these symbols. π
$dirfile->entry_list ($PARENT, $TYPE, $FLAGS)β In scalar context, returns the number of entries matching the supplied criteria. In list context, returns an array of the names of the entries. If$PARENTisundef, top-level entries are considered; otherwise meta entries under$PARENTare considered. For$TYPEand$FLAGS, see"$dirfile-"match_entries>above (the regex flags listed there are ignored by this function), and alsogd_nentries(3)andgd_entry_list(3). π«Ά$dirfile->error ()β Returns the error code of the last operation on this dirfile. Seegd_error(3). π$dirfile->error_string ()β Returns a string describing the error encountered (if any) by the last operation on this dirfile. Seegd_error_string(3). π$dirfile->field_list ()β Equivalent to:"$dirfile->entry_list(undef, undef, undef)". π$dirfile->field_list_by_type ($TYPE)β Equivalent to:"$dirfile->entry_list(undef, $TYPE, undef)". π·οΈ$dirfile->fragment_affixes ($FRAGMENT_INDEX)β Returns an array containing the prefix (first) and suffix (second) of the fragment indexed by$FRAGMENT_INDEX. Seegd_fragment_affixes(3). π$dirfile->fragments ()β In scalar context, returns the number of metadata fragments in the dirfile. In list context, returns an array of pathnames to the fragments on disk, in the order that they're indexed. Seegd_nfragments(3)andgd_fragmentname(3). ποΈ$dirfile->get_carray ($FIELD_CODE, $RETURN_TYPE)β Returns the value of the CARRAY named$FIELD_CODEafter converting its elements to the return type$RETURN_TYPE, which should be one of the symbols listed under "Data Types" above. If$RETURN_TYPEis$GetData::NULL, in scalar context this function returnsundef. Otherwise, if called in scalar context, returns a packed string containing the data. If called in list context, the data will be unpacked and returned as an array. Seegd_get_carray(3). π$dirfile->get_carray_slice ($FIELD_CODE, $START, $LEN, $RETURN_TYPE)β Returns the value of a portion of the CARRAY named$FIELD_CODEafter converting its elements to the return type$RETURN_TYPE, which should be one of the symbols listed under "Data Types" above. The first element returned is given by$START, and the number of elements by$LEN. If$RETURN_TYPEis$GetData::NULL, in scalar context this function returnsundef. Otherwise, if called in scalar context, returns a packed string containing the data. If called in list context, the data will be unpacked and returned as an array. Less data than requested may be returned, if insufficient data exist. Seegd_get_carray_slice(3). βοΈ$dirfile->get_constant ($FIELD_CODE, $RETURN_TYPE)β Returns the value of the CONST named$FIELD_CODEafter converting it to the return type$RETURN_TYPE, which should be one of the symbols listed under "Data Types" above. If$RETURN_TYPEis$GetData::NULL, returnsundefon success. Seegd_get_constant(3). π$dirfile->getdata ($FIELD_CODE, $FIRST_FRAME, $FIRST_SAMP, $NUM_FRAMES, $NUM_SAMP, $RETURN_TYPE)β bestie this is THE one. It grabs data from the field$FIELD_CODEand converts it to$RETURN_TYPE, which has to be one of the symbols from Data Types up above, okurrr. The first sample it hands back is$FIRST_SAMPsamples after the start of$FIRST_FRAME, and the total amount of data returned is$NUM_FRAMESframes plus$NUM_SAMPsamples. β¨ Now here's the tea: if$RETURN_TYPEis$GetData::NULL, then in scalar context this thing returns the number of samples read. Otherwise, in scalar context, you get a string of packed data. And in array context? The data gets unpacked and returned as an array. π Complex data comes back asMath::Complexobjects. Go seegd_getdata(3).$dirfile->get_string ($FIELD_CODE)β hands you the value of the STRING named$FIELD_CODE. Simple, clean, iconic. Seegd_get_string(3).$dirfile->include ($FILE, $PARENT_FRAGMENT, $FLAGS, [$PREFIX, $SUFFIX])β pulls in the fragment metadata file$FILEunder the fragment indexed by$PARENT_FRAGMENT. π«Ά$FLAGSshould be a bitwise-or'd collection of zero or more of these:
$GetData::BIG_ENDIAN, $GetData::CREAT, $GetData::EXCL,
$GetData::FORCE_ENCODING, $GetData::FORCE_ENDIAN,
$GetData::IGNORE_DUPS, $GetData::IGNORE_REFS,
$GetData::LITTLE_ENDIAN, $GetData::PEDANTIC, $GetData::TRUNC,
β¦and at most one of the encoding symbols listed up in the Encoding Types section, or else $GetData::AUTO_ENCODED, which is basically telling GetData "girl, you figure out the encoding yourself." π If $PREFIX or $SUFFIX are left out or set to undef, the fragment you're adding gets no such affix, periodt. See gd_include_affix(3).
$dirfile->madd_carray ($PARENT, $FIELD_NAME, $DATA_TYPE, {DATA...})β adds a brand new CARRAY metafield named$FIELD_NAMEunder the parent field$PARENT. π The storage type is$DATA_TYPE, which needs to be one of the symbols under Data Types above. Then the CARRAY's value gets set to whatever's in the{DATA...}argument list, which also decides how long it is. Check the Input Data section above for what forms{DATA...}is allowed to take. Seegd_madd_carray(3).$dirfile->madd_const ($PARENT, $FIELD_NAME, $DATA_TYPE, [$VALUE])β adds a fresh CONST metafield called$FIELD_NAMEunder the field$PARENT. The$DATA_TYPEsays what the storage type is (one of those Data Types symbols, you know the drill). If you give it a$VALUE, the field's value is set to that; otherwise the field starts out at zero. Seegd_madd_const(3).$dirfile->mcarrays ($PARENT, $RETURN_TYPE)β same energy ascarrays()(q.v.), except it returns CARRAYs that are metafields under the parent you named in$PARENT.$dirfile->mconstants ($PARENT, $RETURN_TYPE)β works likeconstants()(q.v.), but returns CONSTs that are metafields under the parent given by$PARENT.$dirfile->mfield_list ($PARENT)β literally the same thing as$dirfile->entry_list($PARENT, undef, undef).$dirfile->mfield_list_by_type ($PARENT, $TYPE)β exactly equivalent to$dirfile->entry_list($PARENT, $TYPE, undef).$dirfile->mstrings ($PARENT)β behaves likestrings()(q.v.), but returns STRINGs that are metafields under the parent specified by$PARENT.$dirfile->mvector_list ($PARENT)β the same as:
$dirfile->entry_list($PARENT, $GetData::VECTOR_ENTRIES, undef).
$dirfile->parser_callback ($SEHANDLER, $EXTRA=undef)β sets the dirfile's registered parser callback function to$SEHANDLER, or to nothing if you passundef, and updates the$EXTRAparameter too. Seegd_parser_callback(3).$dirfile->put_carray ($FIELD_CODE, {DATA...})β sets the value of the CARRAY named$FIELD_CODEto the values in the{DATA...}argument list. π¦ See the Input Data section above for the allowed forms of{DATA...}. Seegd_put_carray(3).$dirfile->put_carray_slice ($FIELD_CODE, $START, {DATA...})β sets the value of the chunk of the CARRAY named$FIELD_CODEstarting at element number$STARTto the values in the{DATA...}argument list. πΈ Same deal β Input Data section above for the allowed forms of{DATA...}. Seegd_put_carray_slice(3).$dirfile->put_constant ($FIELD_CODE, $DATUM)β sets the value of the CONST field$FIELD_CODEto the value$DATUM. Seegd_put_constant(3).$dirfile->putdata ($FIELD_CODE, $FIRST_FRAME, $FIRST_SAMPLE, {DATA...})β sets part of the vector given by$FIELD_CODEto the values in the{DATA...}argument list. The first sample written is$FIRST_SAMPLEsamples after the start of$FIRST_FRAME. π«Ά Input Data section above for the allowed forms of{DATA...}. Seegd_putdata(3).$dirfile->strings ()β in scalar context it gives you the number of STRING fields. In list context, it gives you an array of strings containing the values of all the STRING fields. Seegd_strings(3).$dirfile->strtok ($STRING)β tokenises$STRINGand hands back an array of tokens. Seegd_strtok(3).$dirfile->vector_list ()β equivalent to:
$dirfile->entry_list(undef, $GetData::VECTOR_ENTRIES, undef).
β¨ Other Methods β¨
Okay so for the most part, these methods act just like their C API counterpart, no cap. π Go read the matching C API manual page for the details. If anything behaves differently, bestie, it's called out right here.
$dirfile->add ($ENTRY)β$ENTRYshould be a reference to an entry hash; peep ENTRY HASHES above. π$dirfile->add_alias ($FIELD_CODE, $TARGET, [$FRAGMENT_INDEX])β$FRAGMENT_INDEX= 0 is assumed if you don't specify it.$dirfile->add_bit ($FIELD_CODE, $IN_FIELD, $BITNUM, $NUMBITS, [$FRAGMENT_INDEX])β$FRAGMENT_INDEX= 0 is assumed if not specified.$dirfile->add_divide ($FIELD_CODE, $IN_FIELD1, $IN_FIELD2, [$FRAGMENT_INDEX])β$FRAGMENT_INDEX= 0 is assumed if not specified.$dirfile->add_lincom ($FIELD_CODE, $N_FIELDS, $IN_FIELDS, $M, $B, [$FRAGMENT_INDEX])β$IN_FIELDS,$M, and$Bshould all be references to arrays of the appropriate length. The elements of$Mand$Bcan be any numerical type,Math::Complexincluded. π$FRAGMENT_INDEX= 0 is assumed if not specified.$dirfile->add_linterp ($FIELD_CODE, $IN_FIELD, $TABLE, [$FRAGMENT_INDEX])β$FRAGMENT_INDEX= 0 is assumed if not specified.$dirfile->add_mplex ($FIELD_CODE, $IN_FIELD, $COUNT_FIELD, $COUNT_VAL, $COUNT_MAX, [$FRAGMENT_INDEX])β$FRAGMENT_INDEX= 0 is assumed if not specified.$dirfile->add_multiply ($FIELD_CODE, $IN_FIELD1, $IN_FIELD2, [$FRAGMENT_INDEX])β$FRAGMENT_INDEX= 0 is assumed if not specified.$dirfile->add_phase ($FIELD_CODE, $IN_FIELD, $SHIFT, [$FRAGMENT_INDEX])β$FRAGMENT_INDEX= 0 is assumed if not specified.$dirfile->add_polynom ($FIELD_CODE, $POLY_ORD, $IN_FIELD, $A, [$FRAGMENT_INDEX])β$Ashould be a reference to an array of numbers (any numerical type,Math::Complexincluded) of the appropriate length.$FRAGMENT_INDEX= 0 is assumed if not specified.$dirfile->add_raw ($FIELD_CODE, $DATA_TYPE, $SPF, [$FRAGMENT_INDEX])β$DATA_TYPEshould be one of the symbols listed under Data Types above.$FRAGMENT_INDEX= 0 is assumed if not specified.$dirfile->add_recip ($FIELD_CODE, $IN_FIELD, $DIVIDEND, [$FRAGMENT_INDEX])β$DIVIDENDcan be any numerical type,Math::Complexincluded.$FRAGMENT_INDEX= 0 is assumed if not specified.$dirfile->add_sbit ($FIELD_CODE, $IN_FIELD, $BITNUM, $NUMBITS, [$FRAGMENT_INDEX])β$FRAGMENT_INDEX= 0 is assumed if not specified.$dirfile->add_spec ($LINE, [$FRAGMENT_INDEX])β$FRAGMENT_INDEX= 0 is assumed if not specified.$dirfile->add_string ($FIELD_CODE, $VALUE, [$FRAGMENT_INDEX])β$FRAGMENT_INDEX= 0 is assumed if not specified.$dirfile->add_window ($FIELD_CODE, $IN_FIELD, $CHECK_FIELD, $WINDOP, $THRESHOLD, [$FRAGMENT_INDEX])β$WINDOPshould be one of the symbols listed under WINDOW Operators above.$FRAGMENT_INDEX= 0 is assumed if not specified.$dirfile->alias_target ($FIELD_CODE)β that's it, that's the whole thing. β¨$dirfile->alter_affixes ($FRAGMENT_INDEX, $PREFIX, [$SUFFIX])β if$PREFIXor$SUFFIXareundef, or if$SUFFIXis just omitted entirely, then that affix is not changed. π$dirfile->alter_bit ($FIELD_CODE, [$IN_FIELD, $BITNUM, $NUMBITS])β arguments you don't give or that are set toundefare not changed. And bonus: if$BITNUM == -1, or$NUMBITS == 0, that parameter also doesn't get changed. π$dirfile->alter_carray ($FIELD_CODE, $CONST_TYPE, $ARRAY_LEN)β$CONST_TYPEshould be one of the symbols listed under Data Types above.$dirfile->alter_const ($FIELD_CODE, [$CONST_TYPE])β if$CONST_TYPEis omitted, or it equals$GetData::NULL, then it's not changed; otherwise it should be one of the symbols listed under Data Types above.$dirfile->alter_divide ($FIELD_CODE, [$IN_FIELD1, $IN_FIELD2])β arguments not given or set toundefare not changed.$dirfile->alter_encoding ($ENCODING, [$FRAGMENT_INDEX, $RECODE])β both$FRAGMENT_INDEXand$RECODEdefault to 0 if you don't give them. π«$dirfile->alter_endianness ($BYTE_SEX, [$FRAGMENT_INDEX, $RECODE])β both$FRAGMENT_INDEXand$RECODEdefault to 0 if not given.$dirfile->alter_entry ($FIELD_CODE, $ENTRY, [$RECODE])β$ENTRYshould be a reference to an entry hash; see ENTRY HASHES above. If you don't give$RECODE, it defaults to 0.$dirfile->alter_frameoffset ($OFFSET, [$FRAGMENT_INDEX, $RECODE])β both$FRAGMENT_INDEXand$RECODEdefault to 0 if not given.$dirfile->alter_lincom ($FIELD_CODE, [$N_FIELDS, $IN_FIELDS, $M, $B])β arguments not given or set toundefare not changed. If you do give them,$IN_FIELDS,$M, and$Bshould be references to arrays of the appropriate length.$dirfile->alter_linterp ($FIELD_CODE, [$IN_FIELD, $TABLE, $RENAME_TABLE])β arguments not given or set toundefare not changed. If$RENAME_TABLEisn't given, it defaults to 0.$dirfile->alter_mplex ($FIELD_CODE, [$IN_FIELD, $COUNT_FIELD, $COUNT_VAL, $COUNT_MAX])β arguments not given or set toundefare not changed. And heads up: if$COUNT_VALor$COUNT_MAXare -1, that parameter is not changed either. π$dirfile->alter_multiply ($FIELD_CODE, [$IN_FIELD1, $IN_FIELD2])β arguments not given or set toundefare not changed.$dirfile->alter_phase ($FIELD_CODE, $IN_FIELD, $SHIFT)β if$IN_FIELD == undef, it is not changed.$dirfile->alter_polynom ($FIELD_CODE, [$POLY_ORD, $IN_FIELD, $A])β bestie, any argument you don't give or set toundefis not changed. And if$POLY_ORD == 0, it also doesn't change. π$dirfile->alter_protection ($PROTECTION_LEVEL, $FRAGMENT_INDEX)π¦$dirfile->alter_raw ($FIELD_CODE, [$DATA_TYPE, $SPF, $RECODE])β args not given orundefstay put. Also, if$DATA_TYPE == $GetData::NULLor$SPF == 0, that parameter is not changed. If$RECODEisn't given, it defaults to0. π$dirfile->alter_recip ($FIELD_CODE, [$IN_FIELD, $DIVIDEND])β args not given orundefstay put. Also, if$DIVIDEND == 0, it is not changed.$DIVIDENDmay be of any numerical type, includingMath::Complex. π₯$dirfile->alter_sbit ($FIELD_CODE, [$IN_FIELD, $BITNUM, $NUMBITS])β args not given orundefstay put. Also, if$BITNUM == -1, or$NUMBITS == 0, that parameter is not changed. π$dirfile->alter_spec ($LINE, [$RECODE])β if$RECODEisn't given, it defaults to0. β¨$dirfile->alter_window ($FIELD_CODE, $IN_FIELD, $CHECK_FIELD, $WINDOP, $THRESHOLD)β if$IN_FIELDor$CHECK_FIELDareundef, or if$WINDOP == $GetData::WINDOP_UNK, that parameter is not changed. Otherwise,$WINDOPshould be one of the symbols listed under WINDOW Operators above. π$dirfile->array_len ($FIELD_CODE)πΈ$dirfile->bof ($FIELD_CODE)π$dirfile->delete ($FIELD_CODE, [$FLAGS])β if$FLAGSisn't given, it defaults to0. Otherwise, it should be a bitwise or'd collection of zero or more of these flags:$GetData::DEL_DATA$GetData::DEL_DEREF$GetData::DEL_FORCE$GetData::DEL_META
$dirfile->desync ([$FLAGS])β if omitted,$FLAGSdefaults to zero. Otherwise, it should be zero or more of these flags bitwise or'd together:$GetData::DESYNC_PATHCHECK$GetData::DESYNC_REOPEN
$dirfile->dirfilename ()π$dirfile->dirfile_standards ([$VERSION])β in addition to a simple integer version number,$VERSIONmay be one of these symbols:$GetData::VERSION_CURRENT$GetData::VERSION_EARLIEST$GetData::VERSION_LATESTIf not given,$GetData::VERSION_CURRENTis assumed. π
$dirfile->encoding ($FRAGMENT_INDEX)π¦$dirfile->endianness ($FRAGMENT_INDEX)πΈ$dirfile->eof ($FIELD_CODE)π$dirfile->error_count ()π$dirfile->flags ([$SET, $RESET])β if omitted,$SETand$RESETdefault to0. Otherwise, they should be zero or more of these flags, bitwise or'd together:$GetData::PRETTY_PRINT$GetData::VERBOSE
$dirfile->flush ($FIELD_CODE)π$dirfile->fragment_index ($FIELD_CODE)β¨$dirfile->fragmentname ($FRAGMENT_INDEX)π$dirfile->frameoffset ($FRAGMENT_INDEX)π¦$dirfile->framenum ($FIELD_CODE, $VALUE, [$START, $END])β$STARTand$ENDdefault to0if not given. π$dirfile->hidden ($FIELD_CODE)π$dirfile->hide ($FIELD_CODE)π$dirfile->madd ($ENTRY, $PARENT)β$ENTRYshould be a reference to an entry hash; see ENTRY HASHES above. π₯$dirfile->madd_alias ($PARENT, $FIELD_CODE, $TARGET)π$dirfile->madd_bit ($PARENT, $FIELD_CODE, $IN_FIELD, $BITNUM, $NUMBITS)π$dirfile->madd_divide ($PARENT, $FIELD_CODE, $IN_FIELD1, $IN_FIELD2)π$dirfile->madd_lincom ($PARENT, $FIELD_CODE, $N_FIELDS, $IN_FIELDS, $M, $B)β$IN_FIELDS,$M, and$Bshould be references to arrays of the appropriate length. The elements of$Mand$Bmay be of any numerical type, includingMath::Complex. π₯$dirfile->madd_linterp ($PARENT, $FIELD_CODE, $IN_FIELD, $TABLE)β¨$dirfile->madd_mplex ($PARENT, $FIELD_CODE, $IN_FIELD, $COUNT_FIELD, $COUNT_VAL, $COUNT_MAX)πΈ$dirfile->madd_multiply ($PARENT, $FIELD_CODE, $IN_FIELD1, $IN_FIELD2)π$dirfile->madd_phase ($PARENT, $FIELD_CODE, $IN_FIELD, $SHIFT)π¦$dirfile->madd_polynom ($PARENT, $FIELD_CODE, $POLY_ORD, $IN_FIELD, $A)β$Ashould be a reference to an array of numbers (of any numerical type, includingMath::Complex) of the appropriate length. π$dirfile->madd_recip ($PARENT, $FIELD_CODE, $IN_FIELD, $DIVIDEND)β$DIVIDENDmay be of any numerical type, includingMath::Complex. π₯$dirfile->madd_sbit ($PARENT, $FIELD_CODE, $IN_FIELD, $BITNUM, $NUMBITS)π$dirfile->madd_spec ($LINE, $PARENT)π$dirfile->madd_string ($PARENT, $FIELD_CODE, $VALUE)π$dirfile->madd_window ($PARENT, $FIELD_CODE, $IN_FIELD, $CHECK_FIELD, $WINDOP, $THRESHOLD)β$WINDOPshould be one of the symbols listed under WINDOW Operators above. β¨$dirfile->malter_spec ($LINE, $PARENT, [$RECODE])β if$RECODEisn't given, it defaults to0. π$dirfile->metaflush ()π§$dirfile->move ($FIELD_CODE, $NEW_FRAGMENT, [$MOVE_DATA])β if not given,$FLAGSdefaults to0. Otherwise, it should be a bitwise or'd collection of zero or more of these flags:$GetData::REN_DANGLE$GetData::REN_DATA$GetData::REN_FORCE$GetData::REN_UPDB
$dirfile->mplex_lookback ($LOOKBACK)πΈ$dirfile->native_type ($FIELD_CODE)β the returned value will be one of the symbols listed above under Data Types. π$dirfile->nframes ()π$dirfile->parent_fragment ($FRAGMENT_INDEX)π¦$dirfile->protection ($FRAGMENT_INDEX)π$dirfile->put_string ($FIELD_CODE, $STRING)β¨$dirfile->raw_close ($FIELD_CODE)π$dirfile->raw_filename ($FIELD_CODE)π$dirfile->reference ([$FIELD_CODE])β if$FIELD_CODEis not given orundef, this function simply reports the current reference field. π₯$dirfile->rename ($OLD_CODE, $NEW_NAME, [$FLAGS])β if not given,$FLAGSdefaults to0. Otherwise, it should be a bitwise or'd collection of zero or more of these flags:$GetData::REN_DANGLE$GetData::REN_DATA$GetData::REN_FORCE$GetData::REN_UPDB
$dirfile->rewrite_fragment ($FRAGMENT_INDEX)π$dirfile->seek ($FIELD_CODE, $FRAME_NUM, $SAMPLE_NUM, [$FLAGS])β if not given,$FLAGSdefaults to$GetData::SEEK_SET. Otherwise, it should be one of:$GetData::SEEK_CUR$GetData::SEEK_END$GetData::SEEK_SETFurthermore, this value should be bitwise or'd with$GetData::SEEK_WRITEif the next operation on the field is a write (via"putdata"). π«Ά
$dirfile->spf ($FIELD_CODE)πΈ$dirfile->sync ($FIELD_CODE)β¨$dirfile->tell ($FIELD_CODE)π$dirfile->unhide ($FIELD_CODE)π$dirfile->uninclude ($FRAGMENT_INDEX, [$DEL])β if not given,$DELdefaults to0. π$dirfile->validate ($FIELD_CODE)π$dirfile->verbose_prefix ([$PREFIX])β if$PREFIXis omitted orundef, the prefix is removed. π¦
π COPYRIGHT π
< purple>Copyright (C) 2012-2015 D. V. Wiebe
GetData is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation: either version 2.1 of the License, or (at your option) any later version.
GetData is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. See the GNU Lesser General Public License for more details.
π SEE ALSO π
This page was served fresh from perl v5.40.1, dated 2025-02-21, and it's the GetData(3pm) manual. Stay iconic, bestie. πβ¨
π¦ where this page comes from
- debian trixie: libgetdata-doc 0.11.0-15
- ubuntu questing: libgetdata-doc 0.11.0-15
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms