Generic function to get the name of the header file, given a file name and a FileFormat instance.
Source: R/all_generic.R, R/file_format.R
header_file-methods.RdDerives the header file name from a given file name based on the FileFormat specifications.
Usage
header_file(x, file_name)
# S4 method for class 'FileFormat,character'
header_file(x, file_name)Arguments
- x
A FileFormat object specifying the format requirements
- file_name
A character string specifying the file name to derive the header file name from
Value
The correct header file name as a character string.
A character string representing the header file name
Details
The function performs the following steps:
If the input file_name already matches the header file format, it returns the file_name as is.
If the file_name matches the data file format, it constructs and returns the corresponding header file name.
If the file_name doesn't match either format, it throws an error.
See also
data_file, strip_extension for related file name
manipulation