ReSharper 2021.2 Help

Predefined File Templates for C++

ReSharper | Templates Explorer | File Templates | C++

This topic lists all predefined file templates for C++ in ReSharper 2021.2. For more information about file templates, see Create files from templates

Template

Details

Struct

Create new header and source files containing an empty C++ Struct in the current project.

Scope C++ projects

Body

$HEADER$#pragma once struct $STRUCT$ {$END$};

Parameters

  • HEADER- Inserts the file header specified in the ReSharper options. (cppFileheader)

  • NAME- Evaluates current file name without extension (getFileNameWithoutExtension)

  • STRUCT- Evaluates current file name without extension with all non-alphanumeric replaced with underscores (getAlphaNumericFileNameWithoutExtension)

  • PCH- Evaluates to an include directive for the precompiled header file or to an empty string if the project does not use precompiled headers. (cppPchIncludeDirective)

  • END- The caret position after the template is applied.

Class

Create new header and source files containing an empty C++ Class in the current project.

Scope C++ projects

Body

$HEADER$#pragma once class $CLASS$ {public:$END$};

Parameters

  • HEADER- Inserts the file header specified in the ReSharper options. (cppFileheader)

  • CLASS- Evaluates current file name without extension with all non-alphanumeric replaced with underscores (getAlphaNumericFileNameWithoutExtension)

  • NAME- Evaluates current file name without extension (getFileNameWithoutExtension)

  • PCH- Evaluates to an include directive for the precompiled header file or to an empty string if the project does not use precompiled headers. (cppPchIncludeDirective)

  • END- The caret position after the template is applied.

Header file

Header file

Scope C++ projects

Body

$HEADER$#pragma once

Parameters

  • HEADER- Inserts the file header specified in the ReSharper options. (cppFileheader)

Source file

Source file

Scope C++ projects

Body

$HEADER$$PCH$

Parameters

  • HEADER- Inserts the file header specified in the ReSharper options. (cppFileheader)

  • PCH- Evaluates to an include directive for the precompiled header file or to an empty string if the project does not use precompiled headers. (cppPchIncludeDirective)

Last modified: 21 October 2021