[DB] Reworked settings for acousticbrainz tagging

This commit is contained in:
emeric
2016-05-28 18:32:09 +02:00
parent b1b139ffcc
commit 2ea4ba7f22
23 changed files with 787 additions and 355 deletions
+9
View File
@@ -87,3 +87,12 @@ void computeCrc(const boost::filesystem::path& p, std::vector<unsigned char>& cr
crc.push_back(data[i]);
}
}
bool ensureDirectory(boost::filesystem::path dir)
{
if (boost::filesystem::exists(dir))
return boost::filesystem::is_directory(dir);
else
return boost::filesystem::create_directory(dir);
}
+5
View File
@@ -27,3 +27,8 @@
boost::filesystem::path searchExecPath(std::string filename);
void computeCrc(const boost::filesystem::path& p, std::vector<unsigned char>& checksum);
// Make sure the given path is a directory
// Create it if needed
bool ensureDirectory(boost::filesystem::path dir);
+8
View File
@@ -112,6 +112,14 @@ stringTrim(const std::string& str, const std::string& whitespace)
return str.substr(strBegin, strRange);
}
std::string
stringTrimEnd(const std::string& str, const std::string& whitespace)
{
return str.substr(0, str.find_last_not_of(whitespace)+1);
}
std::string
stringToUTF8(const std::string& str)
{
+4 -1
View File
@@ -39,7 +39,10 @@ std::vector<std::string>
splitString(std::string string, std::string separators);
std::string
stringTrim(const std::string& str, const std::string& whitespace = " \t");
stringTrim(const std::string& str, const std::string& whitespaces = " \t");
std::string
stringTrimEnd(const std::string& str, const std::string& whitespaces = " \t");
std::string
stringToUTF8(const std::string& str);