1 <?php 2 3 declare(strict_types=1); 4 5 namespace OpenSpout\Reader\XLSX\Manager\SharedStringsCaching; 6 7 /** 8 * @internal 9 */ 10 interface CachingStrategyInterface 11 { 12 /** 13 * Adds the given string to the cache. 14 * 15 * @param string $sharedString The string to be added to the cache 16 * @param int $sharedStringIndex Index of the shared string in the sharedStrings.xml file 17 */ 18 public function addStringForIndex(string $sharedString, int $sharedStringIndex): void; 19 20 /** 21 * Closes the cache after the last shared string was added. 22 * This prevents any additional string from being added to the cache. 23 */ 24 public function closeCache(): void; 25 26 /** 27 * Returns the string located at the given index from the cache. 28 * 29 * @param int $sharedStringIndex Index of the shared string in the sharedStrings.xml file 30 * 31 * @return string The shared string at the given index 32 * 33 * @throws \OpenSpout\Reader\Exception\SharedStringNotFoundException If no shared string found for the given index 34 */ 35 public function getStringAtIndex(int $sharedStringIndex): string; 36 37 /** 38 * Destroys the cache, freeing memory and removing any created artifacts. 39 */ 40 public function clearCache(): void; 41 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body