forked from nanocurrency/nano-node
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a24dd39
commit 641bfa5
Showing
5 changed files
with
52 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,43 @@ | ||
#include <nano/lib/stats_enums.hpp> | ||
#include <nano/lib/utility.hpp> | ||
|
||
#include <magic_enum.hpp> | ||
|
||
std::string_view nano::to_string (nano::stat::type type) | ||
std::string_view nano::stat::to_string (nano::stat::type type) | ||
{ | ||
return magic_enum::enum_name (type); | ||
} | ||
|
||
std::string_view nano::to_string (nano::stat::detail detail) | ||
std::string_view nano::stat::to_string (nano::stat::detail detail) | ||
{ | ||
return magic_enum::enum_name (detail); | ||
} | ||
|
||
std::string_view nano::to_string (nano::stat::dir dir) | ||
std::string_view nano::stat::to_string (nano::stat::dir dir) | ||
{ | ||
return magic_enum::enum_name (dir); | ||
} | ||
|
||
std::vector<nano::stat::type> const & nano::stat::all_types () | ||
{ | ||
static std::vector<nano::stat::type> all = [] () { | ||
return nano::util::enum_values<nano::stat::type> (); | ||
}(); | ||
return all; | ||
} | ||
|
||
std::vector<nano::stat::detail> const & nano::stat::all_details () | ||
{ | ||
static std::vector<nano::stat::detail> all = [] () { | ||
return nano::util::enum_values<nano::stat::detail> (); | ||
}(); | ||
return all; | ||
} | ||
|
||
std::vector<nano::stat::dir> const & nano::stat::all_dirs () | ||
{ | ||
static std::vector<nano::stat::dir> all = [] () { | ||
return nano::util::enum_values<nano::stat::dir> (); | ||
}(); | ||
return all; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters