*
* @author Roland Haeder <webmaster@ship-simu.org>
* @version 0.0.0
- * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2020 Core Developer Team
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
* @license GNU GPL 3.0 or any newer version
* @link http://www.ship-simu.org
*
* @param $pointerInstance An instance of an FilePointer class
* @return void
*/
- protected final function setPointerInstance (FilePointer $pointerInstance) {
+ protected final function setPointerInstance (FilePointer $pointerInstance = NULL) {
$this->pointerInstance = $pointerInstance;
}
* @return void
*/
protected final function unsetPointerInstance () {
- // Simply it to NULL
- $this->pointerInstance = NULL;
+ // Simply invoke setter with no parameter
+ $this->setPointerInstance();
}
/**
*/
public final function getCounter () {
// Get it
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-ABSTRACT-FILE: Getting this->totalEntries=%d ... - CALLED!', $this->totalEntries));
return $this->totalEntries;
}
*/
protected final function setCounter (int $counter) {
// Set it
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-ABSTRACT-FILE: Setting this->totalEntries=%d ... - CALLED!', $counter));
$this->totalEntries = $counter;
}
*/
protected final function incrementCounter () {
// Get it
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-ABSTRACT-FILE: CALLED!');
$this->totalEntries++;
+
+ // Trace message
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-ABSTRACT-FILE: EXIT!');
}
/**
return $this->getPointerInstance()->getFileObject();
}
+ /**
+ * Getter for file's name
+ */
+ public final function getFilename () {
+ // Invole file object's method
+ return $this->getFileObject()->getFilename();
+ }
+
/**
* Close a file source and set it's instance to null and the file name
* to empty
* @return void
*/
public function closeFile () {
- // Debug message
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d]: CALLED!', __METHOD__, __LINE__));
-
// Close down pointer instance as well by unsetting it
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-ABSTRACT-FILE: CALLED!');
$this->unsetPointerInstance();
- // Debug message
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d]: EXIT!', __METHOD__, __LINE__));
+ // Trace message
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-ABSTRACT-FILE: EXIT!');
}
/**