Ejemplo n.º 1
0
 /**
 		Sets the target file or path on which the receiver will act.
 */
 public function setTarget(RTString $aTarget)
 {
     while ($aTarget->hasPrefix("../")) {
         $aTarget = $aTarget->substringFromIndex(3);
     }
     $this->target = $aTarget;
 }
Ejemplo n.º 2
0
 /**
 		Returns a new string made by appending to the receiver a given string. Path
 		separators will be automatically calculated and added where appropriate.
 		\param $aString
 		\returns RTString
 */
 public function stringByAppendingPathComponent(RTString $aString)
 {
     if ($this->length() == 0) {
         return $aString;
     }
     if ($this->hasSuffix("/") && $aString->hasPrefix("/")) {
         $aString = $aString->substringFromIndex(1);
     } else {
         if ($this->hasSuffix("/") == NO && $aString->hasPrefix("/") == NO) {
             $aString = RTString::stringWithString("/")->stringByAppendingString($aString);
         }
     }
     return $this->stringByAppendingString($aString);
 }