]> git.mxchange.org Git - shipsimu.git/blobdiff - inc/classes/main/io/class_FrameworkDirectoryPointer.php
Typos fixed and special command resolver are now possible
[shipsimu.git] / inc / classes / main / io / class_FrameworkDirectoryPointer.php
index 7ce3c4ecb744e4639586a212cf90aa8edd6ec6fc..ccbb545e276c32227c1c2a4925728cf8257bbad2 100644 (file)
@@ -4,9 +4,9 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright(c) 2007, 2008 Roland Haeder, this is free software
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
  * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.ship-simu.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
@@ -39,14 +39,9 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem {
                // Call parent constructor
                parent::__construct(__CLASS__);
 
-               // Set part description
-               $this->setObjectDescription("Helper for handling directories");
-
-               // Create unique ID
-               $this->createUniqueID();
-
                // Clean-up a little
                $this->removeNumberFormaters();
+               $this->removeSystemArray();
        }
 
        /**
@@ -67,11 +62,11 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem {
         * Create a directory pointer based on the given path. The path will also
         * be verified here.
         *
-        * @param       $pathName                               The path name we shall pass
+        * @param               $pathName                                       The path name we shall pass
         *                                                                      to opendir()
-        * @param       $inConstructor                  If we are in de/con-structor
+        * @param               $inConstructor                          If we are in de/con-structor
         *                                                                      or from somewhere else
-        * @throws      PathIsEmptyException    If the provided path name
+        * @throws      PathIsEmptyException            If the provided path name
         *                                                                      is empty
         * @throws      InvalidPathStringException      If the provided path name is
         *                                                                      not a string
@@ -79,9 +74,9 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem {
         *                                                                      not valid
         * @throws      PathReadProtectedException      If the provided path name is
         *                                                                      read-protected
-        * @throws      DirPointerNotOpened             If opendir() returns not a
+        * @throws      DirPointerNotOpened                     If opendir() returns not a
         *                                                                      directory resource
-        * @return      $pointerInstance                A prepared instance of
+        * @return      $pointerInstance                        A prepared instance of
         *                                                                      FrameworkDirectoryPointer
         */
        public final static function createFrameworkDirectoryPointer ($pathName, $inConstructor = false) {
@@ -143,20 +138,8 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem {
         *
         * @return      string  Directory and/or file names read from the current
         *                                      directory pointer
-        * @throws      NullPointerException    If the directory pointer instance
-        *                                                              is not set by setPointer()
-        * @throws      InvalidDirectoryResourceException       If there is being set
-        *                                                                              an invalid directory resource
         */
        public function readRawDirectory () {
-               if (is_null($this->getPointer())) {
-                       // Pointer not initialized
-                       throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
-               } elseif (!is_resource($this->getPointer())) {
-                       // Pointer is not a valid resource!
-                       throw new InvalidDirectoryResourceException($this, self::EXCEPTION_INVALID_DIRECTORY_POINTER);
-               }
-
                // Read data from the directory pointer and return it
                return readdir($this->getPointer());
        }
@@ -197,19 +180,8 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem {
         * to empty
         *
         * @return      void
-        * @throws      NullPointerException    If the directory pointer instance
-        *                                                              is not set by setPointer()
-        * @throws      InvalidDirectoryResourceException       If there is being set
         */
        public function closeDirectory () {
-               if (is_null($this->getPointer())) {
-                       // Pointer not initialized
-                       return;
-               } elseif (!is_resource($this->getPointer())) {
-                       // Pointer is not a valid resource!
-                       throw new InvalidDirectoryResourceException($this, self::EXCEPTION_INVALID_DIRECTORY_POINTER);
-               }
-
                // Close the directory pointer and reset the instance variable
                @closedir($this->getPointer());
                $this->setPointer(null);
@@ -223,7 +195,7 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem {
         * @return      void
         */
        public final function setPointer ($dirPointer) {
-               // Sanity-check if the pointer is a valid directory resource
+               // Sanity-check if pointer is a valid directory resource
                if (is_resource($dirPointer) || is_null($dirPointer)) {
                        // Is a valid resource
                        $this->dirPointer = $dirPointer;