summary refs log tree commit diff stats
path: root/tools/util
diff options
context:
space:
mode:
Diffstat (limited to 'tools/util')
-rw-r--r--tools/util/CMakeLists.txt5
-rw-r--r--tools/util/naming.cpp11
-rw-r--r--tools/util/naming.h8
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 @@
1add_library(util
2 naming.cpp
3)
4set_property(TARGET util PROPERTY CXX_STANDARD 20)
5set_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
5std::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
6std::string GetLetterName(std::string key, bool double_);
7
8#endif /* TOOLS_UTIL_NAMING_H_ */