Skip to content

Add snake case support for file templates

Add option for creating files in snake case into file templates.

Rationale: In case of very long file names it's really hard to find them when they uses lower case and CamelCase is bad for crosspatform defelopment. Typical solution for this issue is snake_case file names: class RenderSystemLocalComponentStorage goes into file rendersystemlocalcomponentstorage.h and it's hard to read but render_system_local_components_storage.h is much better.

Implementation: Current implementation considers following:

  • Each word starts from upper case letter
  • Word can contain only upper case leters
  • If lower case letter found underscore will be placed before previous upper case letter
  • Underscores not added before numbers and symbols (it's not a word start)

Samples: "SomeClass" -> "Some_Class" "VKCommandQueue" -> "VK_Command_Queue" "SIZEConstraint" -> "SIZE_Constraint" "SIZEconstraint" -> "SIZ_Econstraint" "My_Class_WithExtraSTrangeName_MO2Se_5MOS1FET_e" -> "My_Class_With_Extra_S_Trange_Name_MO2_Se_5_MOS1FET_e"

Merge request reports