getEntryType: Get the type of an element in an Office Open archive

View source: R/code.R

getEntryTypeR Documentation

Get the type of an element in an Office Open archive

Description

These functions allows one to determine the nature or purpose of an element in an Office Open archive. It looks up the mapping from file name and extension to type and

Usage

getEntryType(filename, archive, types = computeParts(archive), partialMatch = FALSE)
getEntryTypeByExtension(filename, archive, types = contentTypes(archive), partialMatch = FALSE)

Arguments

filename

the name of the entry in the archive, i.e. the file name of that entry. This can have the preceding / or not. If partialMatch is TRUE this can be any part of the file name that uniquely identifies it, e.g. the base part of the name without the directory assuming that is unique within the archive.

archive

the OOXMLArchive object representing the archive.

types

the collection of mappings from file names and extensions to type names, e.g. "application/vnd.openxmlformats-officedocument.theme+xml" for a theme document.For getEntryTypeByExtension , this is the content types retrieved via contentTypes.

partialMatch

a logical value indicating whether to treat the name of the archive element (filename) as a partial name of an archive element.

Value

A character string giving the type for the input file or extension.

Examples

   #  This shows how we can match by file name using
 #  exact matching or partial matching.
 #  If we don't use partial matching and do not have an exact match,
 #  we match by extension.
  oo = createOODoc(system.file("SampleDocs", "pics.docx", package = "ROOXML"))
  getEntryType("theme1.xml", oo)
  getEntryType("theme1.xml", oo, partial = TRUE)
        

duncantl/ROOXML documentation built on Nov. 23, 2023, 4:22 p.m.