]> git.mxchange.org Git - core.git/blobdiff - inc/classes/main/class_BaseFrameworkSystem.php
Added new interfaces for file i/o classes.
[core.git] / inc / classes / main / class_BaseFrameworkSystem.php
index 01a280da02ee32b936ceec5632c492c303ae986e..abcefc8c35f6b2aaed66eaa6e7fa31ed0e3c14c1 100644 (file)
@@ -173,6 +173,11 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         */
        private $wrapperInstance = NULL;
 
+       /**
+        * An instance of a file I/O pointer class (not handler)
+        */
+       private $pointerInstance = NULL;
+
        /**
         * Thousands separator
         */
@@ -1218,6 +1223,25 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                return $this->iteratorInstance;
        }
 
+       /**
+        * Setter for InputOutputPointer instance
+        *
+        * @param       $pointerInstance        An instance of an InputOutputPointer
+        * @return      void
+        */
+       protected final function setPointerInstance (InputOutputPointer $pointerInstance) {
+               $this->pointerInstance = $pointerInstance;
+       }
+
+       /**
+        * Getter for InputOutputPointer instance
+        *
+        * @return      $pointerInstance        An instance of an InputOutputPointer
+        */
+       public final function getPointerInstance () {
+               return $this->pointerInstance;
+       }
+
        /**
         * Checks whether an object equals this object. You should overwrite this
         * method to implement own equality checks
@@ -2714,6 +2738,23 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                // Return it
                return $isValid;
        }
+
+       /**
+        * Translates boolean TRUE to 'Y' and FALSE to 'N'
+        *
+        * @param       $boolean                Boolean value
+        * @return      $translated             Translated boolean value
+        */
+       public static final function translateBooleanToYesNo ($boolean) {
+               // Make sure it is really boolean
+               assert(is_bool($boolean));
+
+               // "Translate" it
+               $translated = ($boolean === TRUE) ? 'Y' : 'N';
+
+               // ... and return it
+               return $translated;
+       }
 }
 
 // [EOF]