diff options
author | Brad King <brad.king@kitware.com> | 2023-03-09 20:07:35 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-03-09 21:09:48 (GMT) |
commit | 6a84717d172d8c2a7e8fd3c14b264301cfc68d8b (patch) | |
tree | 2d9c10673dece380574e750a093ee4fdb5e8c50b /Source/cmRST.h | |
parent | b6ffbffaf26006a361c1330d0edce9a6314f58bb (diff) | |
download | CMake-6a84717d172d8c2a7e8fd3c14b264301cfc68d8b.zip CMake-6a84717d172d8c2a7e8fd3c14b264301cfc68d8b.tar.gz CMake-6a84717d172d8c2a7e8fd3c14b264301cfc68d8b.tar.bz2 |
cmRST: Convert enum types to enum class
This improves readability and avoids unintended conversions.
Diffstat (limited to 'Source/cmRST.h')
-rw-r--r-- | Source/cmRST.h | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/Source/cmRST.h b/Source/cmRST.h index ea4ef22..65a8a71 100644 --- a/Source/cmRST.h +++ b/Source/cmRST.h @@ -29,26 +29,26 @@ public: bool ProcessFile(std::string const& fname, bool isModule = false); private: - enum IncludeType + enum class Include { - IncludeNormal, - IncludeModule, - IncludeTocTree + Normal, + Module, + TocTree }; - enum MarkupType + enum class Markup { - MarkupNone, - MarkupNormal, - MarkupEmpty + None, + Normal, + Empty }; - enum DirectiveType + enum class Directive { - DirectiveNone, - DirectiveParsedLiteral, - DirectiveLiteralBlock, - DirectiveCodeBlock, - DirectiveReplace, - DirectiveTocTree + None, + ParsedLiteral, + LiteralBlock, + CodeBlock, + Replace, + TocTree }; void ProcessRST(std::istream& is); @@ -59,7 +59,7 @@ private: void OutputLine(std::string const& line, bool inlineMarkup); std::string ReplaceSubstitutions(std::string const& line); void OutputMarkupLines(bool inlineMarkup); - bool ProcessInclude(std::string file, IncludeType type); + bool ProcessInclude(std::string file, Include type); void ProcessDirectiveParsedLiteral(); void ProcessDirectiveLiteralBlock(); void ProcessDirectiveCodeBlock(); @@ -72,8 +72,8 @@ private: int IncludeDepth = 0; bool OutputLinePending = false; bool LastLineEndedInColonColon = false; - MarkupType Markup = MarkupNone; - DirectiveType Directive = DirectiveNone; + Markup MarkupType = Markup::None; + Directive DirectiveType = Directive::None; cmsys::RegularExpression CMakeDirective; cmsys::RegularExpression CMakeModuleDirective; cmsys::RegularExpression ParsedLiteralDirective; |