/** 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; }
/** 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); }