
RarEntry::__toString() 메서드는 RAR 아카이브의 파일 엔트리를 문자열로 변환하는 메서드입니다.
이 메서드의 구현 내용은 다음과 같습니다.
- 파일 이름과 경로를 포함하는 문자열을 반환합니다.
- 파일 크기와 압축 크기를 포함하는 문자열을 반환합니다.
- 파일 타입과 압축 타입을 포함하는 문자열을 반환합니다.
예를 들어, RarEntry::__toString() 메서드의 구현 내용은 다음과 같습니다.
#hostingforum.kr
php
public function __toString()
{
$size = $this->getSize();
$compressedSize = $this->getCompressedSize();
$type = $this->getType();
$compressedType = $this->getCompressedType();
return "파일 이름: $this->getName()n"
. "파일 크기: $size bytesn"
. "압축 크기: $compressedSize bytesn"
. "파일 타입: $typen"
. "압축 타입: $compressedType";
}
이 메서드는 RAR 아카이브의 파일 엔트리를 문자열로 변환하여 반환합니다.
2025-07-28 13:25