diff options
Diffstat (limited to 'tools/util')
-rw-r--r-- | tools/util/CMakeLists.txt | 5 | ||||
-rw-r--r-- | tools/util/naming.cpp | 11 | ||||
-rw-r--r-- | tools/util/naming.h | 8 |
3 files changed, 24 insertions, 0 deletions
diff --git a/tools/util/CMakeLists.txt b/tools/util/CMakeLists.txt new file mode 100644 index 0000000..8eb8d3b --- /dev/null +++ b/tools/util/CMakeLists.txt | |||
@@ -0,0 +1,5 @@ | |||
1 | add_library(util | ||
2 | naming.cpp | ||
3 | ) | ||
4 | set_property(TARGET util PROPERTY CXX_STANDARD 20) | ||
5 | set_property(TARGET util PROPERTY CXX_STANDARD_REQUIRED ON) | ||
diff --git a/tools/util/naming.cpp b/tools/util/naming.cpp new file mode 100644 index 0000000..12594c5 --- /dev/null +++ b/tools/util/naming.cpp | |||
@@ -0,0 +1,11 @@ | |||
1 | #include "naming.h" | ||
2 | |||
3 | #include <sstream> | ||
4 | |||
5 | std::string GetLetterName(std::string key, bool double_) { | ||
6 | std::ostringstream lettername_s; | ||
7 | lettername_s << key; | ||
8 | lettername_s << (double_ ? "2" : "1"); | ||
9 | |||
10 | return lettername_s.str(); | ||
11 | } | ||
diff --git a/tools/util/naming.h b/tools/util/naming.h new file mode 100644 index 0000000..7d61309 --- /dev/null +++ b/tools/util/naming.h | |||
@@ -0,0 +1,8 @@ | |||
1 | #ifndef TOOLS_UTIL_NAMING_H_ | ||
2 | #define TOOLS_UTIL_NAMING_H_ | ||
3 | |||
4 | #include <string> | ||
5 | |||
6 | std::string GetLetterName(std::string key, bool double_); | ||
7 | |||
8 | #endif /* TOOLS_UTIL_NAMING_H_ */ | ||