WIKINDX API trunk

BIBTEXPARSE

BibTeX PARSE

Table of Contents

Properties

$count  : mixed
$entries  : mixed
$expandMacro  : mixed
$fid  : mixed
$fieldExtract  : mixed
$outsideEntry  : mixed
$parseFile  : mixed
$preamble  : mixed
$removeDelimit  : mixed
$strings  : mixed
$undefinedStrings  : mixed

Methods

__construct()  : mixed
BIBTEXPARSE
closeBib()  : mixed
Close bib file
closingDelimiter()  : int
This function receives a string and a closing delimiter '}' or ')'
explodeString()  : array<string|int, string>
This function works like \UTF8\mb_explode('#',$val) but has to take into account whether
extractEntries()  : mixed
This function extract entries taking into account how comments are defined in BibTeX.
extractStringValue()  : string
Extract value part of @string field enclosed by double-quotes or braces.
fieldSplit()  : array<string|int, mixed>
Extract a field
fullSplit()  : mixed
Start splitting a bibtex entry into component fields.
getLine()  : false|string
Get a non-empty line from the bib file or from the bibtexString
loadBibtexString()  : mixed
Load a bibtex string to parse it
loadStringMacro()  : mixed
Set strings macro
openBib()  : mixed
Open bib file
parseEntry()  : mixed
Grab a complete bibtex entry
reduceFields()  : mixed
Extract and format fields
removeDelimiters()  : string
Remove delimiters from a string
removeDelimitersAndExpand()  : string
Remove enclosures around entry field values. Additionally, expand macros if flag set.
returnArrays()  : array<string|int, mixed>
Return arrays of entries etc. to the calling process.

Properties

Methods

__construct()

BIBTEXPARSE

public __construct() : mixed

closeBib()

Close bib file

public closeBib() : mixed

closingDelimiter()

This function receives a string and a closing delimiter '}' or ')'

public closingDelimiter(string $val, string $delimitBegin, string $delimitEnd) : int

and looks for the position of the closing delimiter taking into account the following Bibtex rules: Inside the braces, there can arbitrarily nested pairs of braces, but braces must also be balanced inside quotes! Inside quotes, to place the " character it is not sufficient to simply escape with ": Quotes must be placed inside braces.

Parameters
$val : string
$delimitBegin : string
$delimitEnd : string
Return values
int

(0)

explodeString()

This function works like \UTF8\mb_explode('#',$val) but has to take into account whether

public explodeString(string $val) : array<string|int, string>

the character # is part of a string (i.e., is enclosed into "..." or {...} ) or defines a string concatenation as in @string{ "x # x" # ss # {xx{x}x} }

Parameters
$val : string
Return values
array<string|int, string>

extractEntries()

This function extract entries taking into account how comments are defined in BibTeX.

public extractEntries() : mixed

BibTeX splits the file in two areas: inside an entry and outside an entry, the delimitation being indicated by the presence of a @ sign. When this character is met, BibTex expects to find an entry. Before that sign, and after an entry, everything is considered a comment!

extractStringValue()

Extract value part of @string field enclosed by double-quotes or braces.

public extractStringValue(string $string) : string

The string may be expanded with previously-defined strings

Parameters
$string : string
Return values
string

fieldSplit()

Extract a field

public fieldSplit(string $seg) : array<string|int, mixed>
Parameters
$seg : string
Return values
array<string|int, mixed>

fullSplit()

Start splitting a bibtex entry into component fields.

public fullSplit(string $entry) : mixed

Store the entry type and citation.

Parameters
$entry : string

getLine()

Get a non-empty line from the bib file or from the bibtexString

public getLine() : false|string
Return values
false|string

loadBibtexString()

Load a bibtex string to parse it

public loadBibtexString(string $bibtex_string) : mixed
Parameters
$bibtex_string : string

loadStringMacro()

Set strings macro

public loadStringMacro(array<string|int, mixed> $macro_array) : mixed
Parameters
$macro_array : array<string|int, mixed>

openBib()

Open bib file

public openBib(string $file) : mixed
Parameters
$file : string

parseEntry()

Grab a complete bibtex entry

public parseEntry(string $entry) : mixed
Parameters
$entry : string

reduceFields()

Extract and format fields

public reduceFields(string $oldString) : mixed
Parameters
$oldString : string

removeDelimiters()

Remove delimiters from a string

public removeDelimiters(string $string) : string
Parameters
$string : string
Return values
string

removeDelimitersAndExpand()

Remove enclosures around entry field values. Additionally, expand macros if flag set.

public removeDelimitersAndExpand(string $string[, bool $inpreamble = false ]) : string
Parameters
$string : string
$inpreamble : bool = false

Default is FALSE

Return values
string

returnArrays()

Return arrays of entries etc. to the calling process.

public returnArrays() : array<string|int, mixed>
Return values
array<string|int, mixed>

(preamble, strings, entry, undefinedStrings)


        
On this page

Search results