]> git.mxchange.org Git - shipsimu.git/blobdiff - inc/classes/main/io/class_FrameworkFileOutputPointer.php
A lot rewrites and fixes for weak redirect methods
[shipsimu.git] / inc / classes / main / io / class_FrameworkFileOutputPointer.php
index f3d911a88d2859b55233c036437bd2e7acea12de..84c8ed4078b30080b7cf05ebb135d4ff0df4e167 100644 (file)
@@ -2,11 +2,11 @@
 /**
  * A class for writing files
  *
- * @author             Roland Haeder <webmaster@mxchange.org>
- * @version            0.3.0
- * @copyright  Copyright(c) 2007, 2008 Roland Haeder, this is free software
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
  * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.mxchange.org
+ * @link               http://www.ship-simu.org
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -33,20 +33,15 @@ class FrameworkFileOutputPointer extends BaseFrameworkSystem {
        private $filePointer = null;
 
        /**
-        * Private constructor
+        * Protected constructor
         */
-       private final function __construct () {
+       protected function __construct () {
                // Call parent constructor
-               parent::constructor(__CLASS__);
-
-               // Set part description
-               $this->setObjectDescription("Dateiausgabe-Handler");
-
-               // Create unique ID
-               $this->createUniqueID();
+               parent::__construct(__CLASS__);
 
                // Clean-up a little
                $this->removeNumberFormaters();
+               $this->removeSystemArray();
        }
 
        /**
@@ -67,12 +62,11 @@ class FrameworkFileOutputPointer extends BaseFrameworkSystem {
         * Create a file pointer based on the given file. The file will also
         * be verified here.
         *
-        * @param               $fileName                               The file name we shall pass
-        *                                                              to fopen()
-        * @param               $mode                           The output mode ('w', 'a' are valid)
+        * @param       $fileName       The file name we shall pass to fopen()
+        * @param       $mode           The output mode ('w', 'a' are valid)
         * @throws      FileIsEmptyException    If the provided file name is empty.
         * @throws      FilePointerNotOpened    If fopen() returns not a file
-        *                                                              resource
+        *                                                                      resource
         * @return      void
         */
        public final static function createFrameworkFileOutputPointer ($fileName, $mode) {
@@ -103,12 +97,12 @@ class FrameworkFileOutputPointer extends BaseFrameworkSystem {
        /**
         * Write data to a file pointer
         *
-        * @param               $dataStream     The data stream we shall write to the file
-        * @return      mixed           The result of fwrite()
+        * @param       $dataStream             The data stream we shall write to the file
+        * @return      mixed                   The result of fwrite()
         * @throws      NullPointerException    If the file pointer instance
-        *                                                              is not set by setPointer()
+        *                                                                      is not set by setPointer()
         * @throws      InvalidFileResourceException    If there is being set
-        *                                                                      an invalid file resource
+        *                                                                                      an invalid file resource
         */
        public function writeToFile ($dataStream) {
                if (is_null($this->getPointer())) {
@@ -129,7 +123,7 @@ class FrameworkFileOutputPointer extends BaseFrameworkSystem {
         *
         * @return      void
         * @throws      NullPointerException    If the file pointer instance
-        *                                                              is not set by setPointer()
+        *                                                                      is not set by setPointer()
         * @throws      InvalidFileResourceException    If there is being set
         */
        public function closeFile () {
@@ -150,11 +144,11 @@ class FrameworkFileOutputPointer extends BaseFrameworkSystem {
        /**
         * Setter for the file pointer
         *
-        * @param               $filePointer    File resource
+        * @param       $filePointer    File resource
         * @return      void
         */
        public final function setPointer ($filePointer) {
-               // Sanity-check if the pointer is a valid file resource
+               // Sanity-check if pointer is a valid file resource
                if (is_resource($filePointer) || is_null($filePointer)) {
                        // Is a valid resource
                        $this->filePointer = $filePointer;
@@ -168,7 +162,7 @@ class FrameworkFileOutputPointer extends BaseFrameworkSystem {
         * Getter for the file pointer
         *
         * @return      $filePointer    The file pointer which shall be a valid
-        *                                              file resource
+        *                                                      file resource
         */
        public final function getPointer () {
                return $this->filePointer;
@@ -177,7 +171,7 @@ class FrameworkFileOutputPointer extends BaseFrameworkSystem {
        /**
         * Setter for file name
         *
-        * @param               $fileName               The new file name
+        * @param       $fileName       The new file name
         * @return      void
         */
        public final function setFileName ($fileName) {
@@ -188,7 +182,7 @@ class FrameworkFileOutputPointer extends BaseFrameworkSystem {
        /**
         * Getter for file name
         *
-        * @return      $fileName               The current file name
+        * @return      $fileName       The current file name
         */
        public final function getFileName () {
                return $this->fileName;