Last active
October 30, 2023 13:55
-
-
Save frkd-dev/707e9f01b6d7ced3315180bb6ab1a4d8 to your computer and use it in GitHub Desktop.
VSCode snippet: C++ include header guard from an uppercased relative path as __SRC_UTILS_FILE_HPP__
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"C++ header guard": { | |
"prefix": "guard", | |
"description": "A C++ header include guard from uppercased file's relative path", | |
"body": [ | |
"#ifndef __${1:${RELATIVE_FILEPATH/([\\/.-])|(.)/${1:+_}${2:/upcase}/g}}__", | |
"#define __${1}__", | |
"", | |
"$0", | |
"", | |
"#endif // __${1}__", | |
"" | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment