Get the repository's type map.

Namespace: Perforce.P4
Assembly: p4api.net (in p4api.net.dll) Version: 2017.3.160.836 (2017.3.160.0836)

Syntax

C#
public IList<TypeMapEntry> GetTypeMap()
Visual Basic
Public Function GetTypeMap As IList(Of TypeMapEntry)
Visual C++
public:
IList<TypeMapEntry^>^ GetTypeMap()

Return Value

Remarks

runs the command p4 typemap -o

Remarks


p4 help typemap

typemap -- Edit the filename-to-filetype mapping table

p4 typemap
p4 typemap -o
p4 typemap -i

'p4 typemap' edits a name-to-type mapping table for 'p4 add', which
uses the table to assign a file's filetype based on its name.

The typemap form has a single field, 'TypeMap', followed by any
number of typemap lines. Each typemap line contains a filetype
and a depot file path pattern:

Filetype: See 'p4 help filetypes' for a list of valid filetypes.

Path: Names to be mapped to the filetype. The mapping is
a file pattern in depot syntax. When a user adds a file
matching this pattern, its default filetype is the
file type specified in the table. To exclude files from
the typemap, use exclusionary (-pattern) mappings.
To match all files anywhere in the depot hierarchy,
the pattern must begin with '//...'. To match files
with a specified suffix, use '//.../*.suffix' or
use '//....suffix' (four dots).

Later entries override earlier entries. If no matching entry is found
in the table, 'p4 add' determines the filetype by examining the file's
contents and execution permission bits.

The -o flag writes the typemap table to standard output. The user's
editor is not invoked.

The -i flag reads the typemap table from standard input. The user's
editor is not invoked.

'p4 typemap' requires 'admin' access, which is granted by 'p4 protect'.

Examples

To get the typemap table:
CopyC#
IList<TypeMapEntry> target = Repository.GetTypeMap();

See Also