[DB] Reworked settings for acousticbrainz tagging
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user