Skip to content

Instantly share code, notes, and snippets.

@frkd-dev
Last active October 30, 2023 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frkd-dev/707e9f01b6d7ced3315180bb6ab1a4d8 to your computer and use it in GitHub Desktop.
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__
{
"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