23 if ( preg_match(
'/([A-Za-z ]*)\s*=\s*"((?:\\\"|[^"])*)"\s*;\s*$/', $line, $match ) ) {
26 $key = parent::unescapeString( trim( $match[1] ) );
27 $value = parent::unescapeString( $match[2] );
30 throw new RuntimeException(
"Empty or invalid key in line: $line" );
33 if ( strpos( $key,
' ' ) !==
false ) {
34 throw new RuntimeException(
"Key with space found in line: $line" );
37 return [ $key, $value ];
39 throw new RuntimeException(
"Unrecognized line format: $line." );
49 public static function writeRow( $key, $value ) {
50 return $key .
' = ' . parent::quoteString( $value ) .
';' .
"\n";
AppleFFS class implements support for Apple .strings files.
AppleInfoPlistFfs extends the AppleFFS class and implements support for Apple InfoPlist ....
static writeRow( $key, $value)
Writes well-formed properties file row with key and value.
static readRow( $line)
Parses non-empty strings file row to key and value.