Removed dead code and improve test coverage
This commit is contained in:
@@ -28,10 +28,4 @@ struct uml_alias_missing : public virtual std::runtime_error {
|
||||
}
|
||||
};
|
||||
|
||||
struct substring_delimiter_not_found : public virtual std::runtime_error {
|
||||
substring_delimiter_not_found(const std::string &message)
|
||||
: std::runtime_error(message)
|
||||
{
|
||||
}
|
||||
};
|
||||
} // namespace clanguml::error
|
||||
|
||||
@@ -19,10 +19,6 @@
|
||||
#include "thread_pool_executor.h"
|
||||
|
||||
namespace clanguml::util {
|
||||
thread_pool_executor::thread_pool_executor()
|
||||
: thread_pool_executor{0}
|
||||
{
|
||||
}
|
||||
|
||||
thread_pool_executor::thread_pool_executor(unsigned int pool_size)
|
||||
: done_{false}
|
||||
|
||||
@@ -25,15 +25,13 @@
|
||||
namespace clanguml::util {
|
||||
class thread_pool_executor {
|
||||
public:
|
||||
thread_pool_executor();
|
||||
explicit thread_pool_executor(unsigned int pool_size);
|
||||
|
||||
thread_pool_executor(const thread_pool_executor &) = delete;
|
||||
thread_pool_executor(thread_pool_executor &&) = delete;
|
||||
thread_pool_executor &operator=(const thread_pool_executor &) = delete;
|
||||
thread_pool_executor &operator=(thread_pool_executor &&) = delete;
|
||||
|
||||
explicit thread_pool_executor(unsigned int pool_size);
|
||||
|
||||
~thread_pool_executor();
|
||||
|
||||
std::future<void> add(std::function<void()> &&task);
|
||||
|
||||
@@ -191,20 +191,6 @@ std::string join(
|
||||
return fmt::format("{}", fmt::join(toks, delimiter));
|
||||
}
|
||||
|
||||
std::string unqualify(const std::string &s)
|
||||
{
|
||||
auto toks = clanguml::util::split(s, " ");
|
||||
const std::vector<std::string> qualifiers = {"static", "const", "volatile",
|
||||
"register", "constexpr", "mutable", "struct", "enum"};
|
||||
|
||||
toks.erase(toks.begin(),
|
||||
std::find_if(toks.begin(), toks.end(), [&qualifiers](const auto &t) {
|
||||
return std::count(qualifiers.begin(), qualifiers.end(), t) == 0;
|
||||
}));
|
||||
|
||||
return fmt::format("{}", fmt::join(toks, " "));
|
||||
}
|
||||
|
||||
std::string abbreviate(const std::string &s, const unsigned int max_length)
|
||||
{
|
||||
if (s.size() <= max_length)
|
||||
|
||||
@@ -96,15 +96,6 @@ std::vector<std::string> split(
|
||||
std::string join(
|
||||
const std::vector<std::string> &toks, std::string_view delimiter);
|
||||
|
||||
/**
|
||||
* @brief Remove any qualifiers (e.g. const) from type.
|
||||
*
|
||||
* @param s String spelling of the type.
|
||||
*
|
||||
* @return Unqualified type spelling.
|
||||
*/
|
||||
std::string unqualify(const std::string &s);
|
||||
|
||||
/**
|
||||
* @brief Abbreviate string to max_length, and replace last 3 characters
|
||||
* with ellipsis.
|
||||
|
||||
Reference in New Issue
Block a user