You are here

public function PARSEENTRIES::getLine in Bibliography Module 7

Same name and namespace in other branches
  1. 5 bibtexParse/PARSEENTRIES.php \PARSEENTRIES::getLine()
  2. 6.2 modules/bibtexParse/PARSEENTRIES.php \PARSEENTRIES::getLine()
  3. 6 bibtexParse/PARSEENTRIES.php \PARSEENTRIES::getLine()
  4. 7.3 plugins/biblio_style/bibtex/PARSEENTRIES.php \PARSEENTRIES::getLine()
  5. 7.2 modules/bibtexParse/PARSEENTRIES.php \PARSEENTRIES::getLine()

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

1 call to PARSEENTRIES::getLine()
PARSEENTRIES::extractEntries in modules/bibtexParse/PARSEENTRIES.php
This function extract entries taking into account how comments are defined in BibTeX. 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,…

File

modules/bibtexParse/PARSEENTRIES.php, line 216

Class

PARSEENTRIES
// Parse a file $parse = NEW PARSEENTRIES(); $parse->expandMacro = TRUE; // $array = array("RMP" =>"Rev., Mod. Phys."); // $parse->loadStringMacro($array); // $parse->removeDelimit = FALSE; // …

Code

public function getLine() {
  if ($this->parseFile) {
    if (!feof($this->fid)) {
      do {
        $line = trim(fgets($this->fid));
      } while (!feof($this->fid) && !$line);
      return $line;
    }
    return FALSE;
  }
  else {
    do {
      $line = array_shift($this->bibtexString);
      $line = trim($line);
      $this->currentLine++;
    } while ($this->bibtexString && !$line);
    return $line;
  }
}