aboutsummaryrefslogtreecommitdiff
path: root/src/mnemonics/electrum-words.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mnemonics/electrum-words.cpp')
-rw-r--r--src/mnemonics/electrum-words.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/mnemonics/electrum-words.cpp b/src/mnemonics/electrum-words.cpp
index 3d79ecf6e..756306014 100644
--- a/src/mnemonics/electrum-words.cpp
+++ b/src/mnemonics/electrum-words.cpp
@@ -42,6 +42,7 @@
#include <fstream>
#include "mnemonics/electrum-words.h"
#include <stdexcept>
+#include <boost/filesystem.hpp>
namespace
{
@@ -82,7 +83,7 @@ namespace crypto
namespace ElectrumWords
{
- void init(const std::string &language, bool old_word_list = false)
+ void init(const std::string &language, bool old_word_list)
{
if (old_word_list)
{
@@ -188,6 +189,22 @@ namespace crypto
return false;
}
+ void get_language_list(std::vector<std::string> &languages)
+ {
+ languages.clear();
+ boost::filesystem::path languages_directory("wordlists/languages");
+ if (!boost::filesystem::exists(languages_directory) ||
+ !boost::filesystem::is_directory(languages_directory))
+ {
+ throw std::runtime_error("Word list languages directory is missing.");
+ }
+ boost::filesystem::directory_iterator end;
+ for (boost::filesystem::directory_iterator it(languages_directory); it != end; it++)
+ {
+ languages.push_back(it->path().filename().string());
+ }
+ }
+
} // namespace ElectrumWords
} // namespace crypto