AkiraMiyakoda / cppIncludeGuard

Visual Studio Code extension to insert C/C++ include guard macros.
https://marketplace.visualstudio.com/items?itemName=akiramiyakoda.cppincludeguard
MIT License
30 stars 13 forks source link

Insert C/C++ Include Guard Macros

GitHub Codacy Badge Visual Studio Marketplace Installs Visual Studio Marketplace Downloads Visual Studio Marketplace Rating

The C/C++ Include Guard extension enables you to add, remove or update include guard macros to your C/C++ header files in one go.

Thanks to contributors: @erkan-ozkan, @HO-COOH, @sleiner, @Philanatidae, @alexolog, headhunter45, smuke

Screenshots

Automatically insert include guard when creating a new header file

Automatic Insert

Insert and Remove include guard

Insert and Remove

Update existing include guard

Update existing

Automatically update include guard when renaming a header file

Automatic updating

Features

// GUID
#define E8A33412_A210_4F05_99A4_F6E2019B7137
// File name
#define UTILS_H
// File path form the prject root
#define FOO_BAR_UTILS_H
/* Block comment. */
#endif /* AE2E827A_F4B3_422C_801F_DF9020986F2B */

// Line comment.
#endif // B93E7584_5E15_48C3_9D9C_92263000BF7B

// Without comment.
#endif
// Can prevent ill-formed macros like this.
#define 47A7840C_D31B_4D39_BF77_E5E957F0A97A
#define ABC_7FE87DA8_601D_4D8E_AEE5_E6BE6EAB5678_XYZ
// From a path like 'foo/_bar_/utils.h'.
#define FOO_BAR_UTILS_H     // not FOO__BAR__UTILS_H
// From a path like 'foo/bar/utils.h'.
#define FOO_BAR_UTILS
// From a path like 'foo/bar/utils.h'.
#define BAR_UTILS
/**
 * Copyright (c) 2019 Akira Miyakoda
 *
 * This software is released under the MIT License.
 * https://opensource.org/licenses/MIT
 */

#ifndef FOO_BAR_UTILS_H     // <- Inserted here.
#define FOO_BAR_UTILS_H